Hello Reynir,
On Wed, 29 Nov 2006, Reynir Stefansson wrote:
Ping ? Have you tried the patch ?
On Tue, 21 Nov 2006, Pavel Tsekov wrote:
Hello,
On Fri, 17 Nov 2006, Reynir Stefansson wrote:
Moving mcedit's cursor by mouse appears to not update the cursor
position fully. Search/replace may still be using the old spot as
reference. This is in plain patchless mc 4.6.1. Temporary workaround:
Jiggle the cursor with the cursor keys after mousing.
The attached patch should fix the problem. Please, give it a try.
Thanks!
Sorry I'm late. Been reading up on some Harry Potter fanfic. Was way
behind and plum forgot the world exists.
The patch did apply, though 'patch' muttered some invectives about
having to shift the chunks about.
First tests show that the patch works as intended. That makes it one
less minor annoyance done away with. :-)
The opposite bracket still glows if the cursor stood on a bracket when
you moused away, but I see that as a wash-your-dog-first bug.
Please, test the attached patch. Let me know if you find
other inconsistencies.
Thanks!
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 4 Dec 2006 11:34:18 -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 */
@@ -118,6 +104,7 @@ edit_event (WEdit * edit, Gpm_Event * ev
edit_mark_cmd (edit, 0);
update:
+ edit_find_bracket (edit);
edit->force |= REDRAW_COMPLETELY;
edit_update_curs_row (edit);
edit_update_curs_col (edit);
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 4 Dec 2006 11:34:18 -0000
@@ -134,11 +138,13 @@ 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);
void edit_update_curs_row (WEdit * edit);
void edit_update_curs_col (WEdit * edit);
+void edit_find_bracket (WEdit * edit);
void edit_block_copy_cmd (WEdit * edit);
void edit_block_move_cmd (WEdit * edit);
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 4 Dec 2006 11:34:18 -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);
@@ -2075,7 +2132,7 @@ static long edit_get_bracket (WEdit * ed
static long last_bracket = -1;
-static void edit_find_bracket (WEdit * edit)
+void edit_find_bracket (WEdit * edit)
{
edit->bracket = edit_get_bracket (edit, 1, 10000);
if (last_bracket != edit->bracket)
_______________________________________________
Mc mailing list
http://mail.gnome.org/mailman/listinfo/mc