1 Subject: "tail" option for backward_word()
3 NEdit*text.translations: #override \
4 Alt Shift Ctrl<KeyPress>osfLeft: backward_word("extend", "tail")\n\
5 Meta Shift Ctrl<KeyPress>osfLeft: backward_word("extend", "tail")\n\
6 Alt Ctrl<KeyPress>osfLeft: backward_word("tail")\n\
7 Meta Ctrl<KeyPress>osfLeft: backward_word("tail")\n\
8 Alt Shift Ctrl<KeyPress>osfRight: forward_word("extend", "tail")\n\
9 Meta Shift Ctrl<KeyPress>osfRight: forward_word("extend", "tail")\n\
10 Alt Ctrl<KeyPress>osfRight: forward_word("tail")\n\
11 Meta Ctrl<KeyPress>osfRight: forward_word("tail")\n\
16 doc/help.etx | 5 +++--
17 source/text.c | 21 +++++++++++++++++----
18 2 files changed, 20 insertions(+), 6 deletions(-)
20 diff --quilt old/source/text.c new/source/text.c
23 @@ -2691,11 +2691,24 @@ static void backwardWordAP(Widget w, XEv
24 ringIfNecessary(silent, w);
28 pos = max(insertPos - 1, 0);
29 - while (strchr(delimiters, BufGetCharacter(buf, pos)) != NULL && pos > 0)
31 - pos = startOfWord((TextWidget)w, pos);
33 + if (hasKey("tail", args, nArgs)) {
34 + pos = max(startOfWord((TextWidget)w, pos) - 1, 0);
36 + if (strchr(delimiters, BufGetCharacter(buf, pos)) == NULL)
44 + while (strchr(delimiters, BufGetCharacter(buf, pos)) != NULL && pos > 0)
46 + pos = startOfWord((TextWidget)w, pos);
49 TextDSetInsertPosition(textD, pos);
50 checkMoveSelectionChange(w, event, insertPos, args, nArgs);
51 checkAutoShowInsertPos(w);
52 diff --quilt old/doc/help.etx new/doc/help.etx
55 @@ -3312,11 +3312,12 @@ Action Routines
56 the beginning of the previous paragraph. Paragraphs are defined as regions
57 of text delimited by one or more blank lines.
59 -**backward_word( ["nobell"] )**
60 +**backward_word( ["tail"] ["nobell"] )**
61 Moves the cursor to the beginning of a word, or, if the
62 cursor is already at the beginning of a word, moves the cursor to the
63 beginning of the previous word. Word delimiters are user-settable, and
64 - defined by the X resource wordDelimiters.
65 + defined by the X resource wordDelimiters. If the "tail" argument is supplied
66 + the cursor is moved to the end of the next previous word.
68 **beginning_of_file( ["scrollbar"] )**
69 Moves the cursor to the beginning of the file.