Ticket #2483 (new enhancement) — at Version 3

Opened 14 years ago

Last modified 14 years ago

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

comment:1 Changed 14 years ago by angel_il

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))

comment:2 Changed 14 years ago by angel_il

  • Type changed from defect to enhancement

comment:3 Changed 14 years ago by angel_il

  • Description modified (diff)

branch: 2483_editor_word_left_improvement

Note: See TracTickets for help on using tickets.