refresh InterpretDebug5.diff
[nedit-bw.git] / extended-paragraph-end.patch
blob1a51079b89e685f8f07b6fcd02aa7680efbadad3
1 Subject: "end" option for paragraph jumping
3 With the "end" option paragraph jumping stops at the first blank line after
4 a paragraph.
6 ---
8 doc/help.etx | 13 +++++++++----
9 source/text.c | 16 +++++++++-------
10 2 files changed, 18 insertions(+), 11 deletions(-)
12 diff --quilt old/source/text.c new/source/text.c
13 --- old/source/text.c
14 +++ new/source/text.c
15 @@ -2773,6 +2773,7 @@ static void forwardParagraphAP(Widget w,
16 int pos, insertPos = TextDGetInsertPosition(textD);
17 textBuffer *buf = textD->buffer;
18 int silent = hasKey("nobell", args, nArgs);
19 + int not_end = !hasKey("end", args, nArgs);
21 cancelDrag(w);
23 @@ -2783,9 +2784,9 @@ static void forwardParagraphAP(Widget w,
26 /* need to skip current paragraph? */
27 - if (!lineIsBlank(buf, insertPos, &pos)) {
28 + if (not_end != lineIsBlank(buf, insertPos, &pos)) {
29 while (pos < buf->length) {
30 - if (nextLineIsBlank(buf, pos, &pos)) {
31 + if (not_end == nextLineIsBlank(buf, pos, &pos)) {
32 break;
35 @@ -2793,7 +2794,7 @@ static void forwardParagraphAP(Widget w,
37 /* skip all blank lines */
38 while (pos < buf->length) {
39 - if (!nextLineIsBlank(buf, pos, &pos)) {
40 + if (not_end != nextLineIsBlank(buf, pos, &pos)) {
41 break;
44 @@ -2811,6 +2812,7 @@ static void backwardParagraphAP(Widget w
45 int parStart, pos, insertPos = TextDGetInsertPosition(textD);
46 textBuffer *buf = textD->buffer;
47 int silent = hasKey("nobell", args, nArgs);
48 + int not_end = !hasKey("end", args, nArgs);
50 cancelDrag(w);
52 @@ -2820,11 +2822,11 @@ static void backwardParagraphAP(Widget w
53 return;
56 - if (lineIsBlank(buf, insertPos, &parStart)
57 + if (not_end == lineIsBlank(buf, insertPos, &parStart)
58 || (insertPos == parStart
59 - && prevLineIsBlank(buf, parStart, &parStart))) {
60 + && not_end == prevLineIsBlank(buf, parStart, &parStart))) {
61 while (parStart > 0) {
62 - if (!prevLineIsBlank(buf, parStart, &pos)) {
63 + if (not_end != prevLineIsBlank(buf, parStart, &pos)) {
64 break;
66 parStart = pos;
67 @@ -2832,7 +2834,7 @@ static void backwardParagraphAP(Widget w
70 while (parStart > 0) {
71 - if (prevLineIsBlank(buf, parStart, &pos)) {
72 + if (not_end == prevLineIsBlank(buf, parStart, &pos)) {
73 break;
75 parStart = pos;
76 diff --quilt old/doc/help.etx new/doc/help.etx
77 --- old/doc/help.etx
78 +++ new/doc/help.etx
79 @@ -3306,11 +3306,13 @@ Action Routines
80 **backward_character( ["nobell"] )**
81 Moves the cursor one character to the left.
83 -**backward_paragraph(["nobell"] )**
84 +**backward_paragraph( ["end"] ["nobell"] )**
85 Moves the cursor to the beginning of the paragraph, or
86 if the cursor is already at the beginning of a paragraph, moves the cursor to
87 the beginning of the previous paragraph. Paragraphs are defined as regions
88 - of text delimited by one or more blank lines.
89 + of text delimited by one or more blank lines. If the "end" option is given
90 + the cursor is moved to the end of previous paragraph. The end of a paragraph
91 + is the first blank line after the paragraph, if any.
93 **backward_word( ["tail"] ["nobell"] )**
94 Moves the cursor to the beginning of a word, or, if the
95 @@ -3431,10 +3433,13 @@ Action Routines
96 **forward_character()**
97 Moves the cursor one character to the right.
99 -**forward_paragraph( ["nobell"] )**
100 +**forward_paragraph( ["end"] ["nobell"] )**
101 Moves the cursor to the beginning of the next paragraph.
102 Paragraphs are defined as regions of text delimited by one or more blank
103 - lines.
104 + lines. If the "end" optione is given, the cursor is moved to the end of the
105 + current paragraph, or to the end of the next paragraph if the current line
106 + is a blank line. The end of a paragraph is the first blank line after the
107 + paragraph, if any.
109 **forward_word( ["tail"] ["nobell"] )**
110 Moves the cursor to the beginning of the next word. Word