Index: edit/editwidget.c =================================================================== RCS file: /sources/mc/mc/edit/editwidget.c,v retrieving revision 1.63 diff -u -p -r1.63 editwidget.c --- edit/editwidget.c 7 Sep 2005 08:54:12 -0000 1.63 +++ edit/editwidget.c 21 Nov 2006 20:27:27 -0000 @@ -86,28 +86,14 @@ edit_event (WEdit * edit, Gpm_Event * ev if (event->type & (GPM_DOWN | GPM_UP)) edit_push_key_press (edit); - edit_cursor_move (edit, edit_bol (edit, edit->curs1) - edit->curs1); + edit->prev_col = event->x - edit->start_col - 1; if (--event->y > (edit->curs_row + 1)) - edit_cursor_move (edit, - edit_move_forward (edit, edit->curs1, - event->y - (edit->curs_row + - 1), 0) - - edit->curs1); - - if (event->y < (edit->curs_row + 1)) - edit_cursor_move (edit, - edit_move_backward (edit, edit->curs1, - (edit->curs_row + 1) - - event->y) - edit->curs1); - - edit_cursor_move (edit, - (int) edit_move_forward3 (edit, edit->curs1, - event->x - - edit->start_col - 1, - 0) - edit->curs1); - - edit->prev_col = edit_get_col (edit); + edit_move_down (edit, event->y - (edit->curs_row + 1), 0); + else if (event->y < (edit->curs_row + 1)) + edit_move_up (edit, (edit->curs_row + 1) - event->y, 0); + else + edit_move_to_prev_col (edit, edit_bol (edit, edit->curs1)); if (event->type & GPM_DOWN) { edit_mark_cmd (edit, 1); /* reset */ Index: edit/edit.h =================================================================== RCS file: /sources/mc/mc/edit/edit.h,v retrieving revision 1.86 diff -u -p -r1.86 edit.h --- edit/edit.h 4 Feb 2006 14:41:42 -0000 1.86 +++ edit/edit.h 21 Nov 2006 20:27:27 -0000 @@ -134,6 +138,7 @@ void edit_scroll_right (WEdit * edit, in void edit_scroll_left (WEdit * edit, int i); void edit_move_up (WEdit * edit, unsigned long i, int scroll); void edit_move_down (WEdit * edit, int i, int scroll); +void edit_move_to_prev_col (WEdit *edit, long p); int edit_get_col (WEdit * edit); long edit_bol (WEdit * edit, long current); long edit_eol (WEdit * edit, long current); Index: edit/edit.c =================================================================== RCS file: /sources/mc/mc/edit/edit.c,v retrieving revision 1.110 diff -u -p -r1.110 edit.c --- edit/edit.c 17 Nov 2006 21:50:33 -0000 1.110 +++ edit/edit.c 21 Nov 2006 20:27:28 -0000 @@ -100,7 +116,6 @@ char *option_backup_ext = NULL; */ -static void edit_move_to_prev_col (WEdit *edit, long p); static void user_menu (WEdit *edit); int edit_get_byte (WEdit * edit, long byte_index) @@ -1354,7 +1411,7 @@ static int is_in_indent (WEdit *edit) static int left_of_four_spaces (WEdit *edit); -static void +void edit_move_to_prev_col (WEdit * edit, long p) { edit_cursor_move (edit, edit_move_forward3 (edit, p, edit->prev_col, 0) - edit->curs1);