Ticket #1956 (mcedit: moving cursor to the empty last line problem)

fixed cursor movement in empty last line.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
This commit is contained in:
Ilia Maslakov 2010-01-20 14:07:09 +03:00
parent 98e4c93e5c
commit 519e2a30cb

View File

@ -2133,7 +2133,8 @@ static void edit_left_char_move_cmd (WEdit * edit)
= FALSE - move down = FALSE - move down
*/ */
static void 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 p;
unsigned long l = (direction) unsigned long l = (direction)
? edit->curs_line ? 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); edit_move_to_prev_col (edit, p);
/* search start of current multibyte char (like CJK) */ /* search start of current multibyte char (like CJK) */
edit_right_char_move_cmd (edit); if (edit->curs1 + 1 < edit->last_byte) {
edit_left_char_move_cmd (edit); edit_right_char_move_cmd (edit);
edit_left_char_move_cmd (edit);
}
edit->search_start = edit->curs1; edit->search_start = edit->curs1;
edit->found_len = 0; edit->found_len = 0;