From 519e2a30cb86acf88d291f785f4d37fffdd09007 Mon Sep 17 00:00:00 2001 From: Ilia Maslakov Date: Wed, 20 Jan 2010 14:07:09 +0300 Subject: [PATCH] Ticket #1956 (mcedit: moving cursor to the empty last line problem) fixed cursor movement in empty last line. Signed-off-by: Ilia Maslakov --- src/editor/edit.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/editor/edit.c b/src/editor/edit.c index c49d08e2c..7f94c9f39 100644 --- a/src/editor/edit.c +++ b/src/editor/edit.c @@ -2133,7 +2133,8 @@ static void edit_left_char_move_cmd (WEdit * edit) = FALSE - move down */ static void -edit_move_updown (WEdit * edit, unsigned long i, int scroll, gboolean direction) { +edit_move_updown (WEdit * edit, unsigned long i, int scroll, gboolean direction) +{ unsigned long p; unsigned long l = (direction) ? edit->curs_line @@ -2164,8 +2165,10 @@ edit_move_updown (WEdit * edit, unsigned long i, int scroll, gboolean direction) edit_move_to_prev_col (edit, p); /* search start of current multibyte char (like CJK) */ - edit_right_char_move_cmd (edit); - edit_left_char_move_cmd (edit); + if (edit->curs1 + 1 < edit->last_byte) { + edit_right_char_move_cmd (edit); + edit_left_char_move_cmd (edit); + } edit->search_start = edit->curs1; edit->found_len = 0;