InterpretDebug-mods: calculate OpName length
[nedit-bw.git] / extended-paragraph-end.patch
blobb0bca221e4288128dd13a1eb3736612ec78cc2b4
1 ---
3 doc/help.etx | 13 +++++++++----
4 source/text.c | 16 +++++++++-------
5 2 files changed, 18 insertions(+), 11 deletions(-)
7 diff --quilt old/source/text.c new/source/text.c
8 --- old/source/text.c
9 +++ new/source/text.c
10 @@ -2771,31 +2771,32 @@ static void forwardParagraphAP(Widget w,
12 textDisp *textD = ((TextWidget)w)->text.textD;
13 int pos, insertPos = TextDGetInsertPosition(textD);
14 textBuffer *buf = textD->buffer;
15 int silent = hasKey("nobell", args, nArgs);
16 + int not_end = !hasKey("end", args, nArgs);
18 cancelDrag(w);
20 /* check if we are at the end of the file, than return */
21 if (insertPos == buf->length) {
22 ringIfNecessary(silent, w);
23 return;
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;
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;
45 TextDSetInsertPosition(textD, min(pos, buf->length));
46 @@ -2809,32 +2810,33 @@ static void backwardParagraphAP(Widget w
48 textDisp *textD = ((TextWidget)w)->text.textD;
49 int parStart, pos, insertPos = TextDGetInsertPosition(textD);
50 textBuffer *buf = textD->buffer;
51 int silent = hasKey("nobell", args, nArgs);
52 + int not_end = !hasKey("end", args, nArgs);
54 cancelDrag(w);
56 /* check if we are at the beginning of the file, than return */
57 if (0 == insertPos) {
58 ringIfNecessary(silent, w);
59 return;
62 - if (lineIsBlank(buf, insertPos, &parStart)
63 + if (not_end == lineIsBlank(buf, insertPos, &parStart)
64 || (insertPos == parStart
65 - && prevLineIsBlank(buf, parStart, &parStart))) {
66 + && not_end == prevLineIsBlank(buf, parStart, &parStart))) {
67 while (parStart > 0) {
68 - if (!prevLineIsBlank(buf, parStart, &pos)) {
69 + if (not_end != prevLineIsBlank(buf, parStart, &pos)) {
70 break;
72 parStart = pos;
76 while (parStart > 0) {
77 - if (prevLineIsBlank(buf, parStart, &pos)) {
78 + if (not_end == prevLineIsBlank(buf, parStart, &pos)) {
79 break;
81 parStart = pos;
84 diff --quilt old/doc/help.etx new/doc/help.etx
85 --- old/doc/help.etx
86 +++ new/doc/help.etx
87 @@ -3305,15 +3305,17 @@ Action Routines
88 is supplied.
90 **backward_character( ["nobell"] )**
91 Moves the cursor one character to the left.
93 -**backward_paragraph(["nobell"] )**
94 +**backward_paragraph( ["end"] ["nobell"] )**
95 Moves the cursor to the beginning of the paragraph, or
96 if the cursor is already at the beginning of a paragraph, moves the cursor to
97 the beginning of the previous paragraph. Paragraphs are defined as regions
98 - of text delimited by one or more blank lines.
99 + of text delimited by one or more blank lines. If the "end" option is given
100 + the cursor is moved to the end of previous paragraph. The end of a paragraph
101 + is the first blank line after the paragraph, if any.
103 **backward_word( ["tail"] ["nobell"] )**
104 Moves the cursor to the beginning of a word, or, if the
105 cursor is already at the beginning of a word, moves the cursor to the
106 beginning of the previous word. Word delimiters are user-settable, and
107 @@ -3430,14 +3432,17 @@ Action Routines
108 negative-index (numbers less than 0, -1 is the same as "last").
110 **forward_character()**
111 Moves the cursor one character to the right.
113 -**forward_paragraph( ["nobell"] )**
114 +**forward_paragraph( ["end"] ["nobell"] )**
115 Moves the cursor to the beginning of the next paragraph.
116 Paragraphs are defined as regions of text delimited by one or more blank
117 - lines.
118 + lines. If the "end" optione is given, the cursor is moved to the end of the
119 + current paragraph, or to the end of the next paragraph if the current line
120 + is a blank line. The end of a paragraph is the first blank line after the
121 + paragraph, if any.
123 **forward_word( ["tail"] ["nobell"] )**
124 Moves the cursor to the beginning of the next word. Word
125 delimiters are user-settable, and defined by the X resource wordDelimiters.
126 If the "tail" argument is supplied the cursor will be moved to