Ticket #2483 (new enhancement) — at Version 3
not intuitive behavior EditWordLeft, EditWordRight
| Reported by: | angel_il | Owned by: | |
|---|---|---|---|
| Priority: | trivial | Milestone: | 4.8.0-pre1 |
| Component: | mcedit | Version: | 4.7.5 |
| Keywords: | Cc: | ||
| Blocked By: | Blocking: | ||
| Branch state: | Votes for changeset: |
Description (last modified by angel_il) (diff)
not intuitive behavior EditWordLeft?, EditWordRight?
The cursor not stop beside BOL, EOL after "word left"/"word left".
Change History
Note: See
TracTickets for help on using
tickets.

diff --git a/src/editor/edit.c b/src/editor/edit.c index 9f083af..3f20b54 100644 --- a/src/editor/edit.c +++ b/src/editor/edit.c @@ -1054,6 +1054,8 @@ edit_left_word_move (WEdit * edit, int s) c2 = edit_get_byte (edit, edit->curs1); if (!(my_type_of (c1) & my_type_of (c2))) break; + if (c1 == '\n' || c2 == '\n') + break; if (isspace (c1) && !isspace (c2)) break; if (s) @@ -1088,6 +1090,8 @@ edit_right_word_move (WEdit * edit, int s) break; c1 = edit_get_byte (edit, edit->curs1 - 1); c2 = edit_get_byte (edit, edit->curs1); + if (c1 == '\n' || c2 == '\n') + break; if (!(my_type_of (c1) & my_type_of (c2))) break; if (isspace (c1) && !isspace (c2))