mirror of git://git.sv.gnu.org/nano.git
*really* fix mouse support breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2932 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
parent
56d083779f
commit
94d7cb6826
13
src/nano.c
13
src/nano.c
|
@ -1727,7 +1727,8 @@ bool do_mouse(void)
|
||||||
/* Did they click on the line with the cursor? If they
|
/* Did they click on the line with the cursor? If they
|
||||||
* clicked on the cursor, we set the mark. */
|
* clicked on the cursor, we set the mark. */
|
||||||
const filestruct *current_save = openfile->current;
|
const filestruct *current_save = openfile->current;
|
||||||
size_t new_current_x, pww_save = openfile->placewewant;
|
size_t current_x_save = openfile->current_x;
|
||||||
|
size_t pww_save = openfile->placewewant;
|
||||||
|
|
||||||
/* Subtract out the size of topwin. */
|
/* Subtract out the size of topwin. */
|
||||||
mouse_y -= 2 - no_more_space();
|
mouse_y -= 2 - no_more_space();
|
||||||
|
@ -1742,20 +1743,18 @@ bool do_mouse(void)
|
||||||
openfile->current->prev != NULL; openfile->current_y--)
|
openfile->current->prev != NULL; openfile->current_y--)
|
||||||
openfile->current = openfile->current->prev;
|
openfile->current = openfile->current->prev;
|
||||||
|
|
||||||
new_current_x = actual_x(openfile->current->data,
|
openfile->current_x = actual_x(openfile->current->data,
|
||||||
get_page_start(xplustabs() + mouse_x));
|
get_page_start(xplustabs()) + mouse_x);
|
||||||
|
openfile->placewewant = xplustabs();
|
||||||
|
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
/* Clicking where the cursor is toggles the mark, as does
|
/* Clicking where the cursor is toggles the mark, as does
|
||||||
* clicking beyond the line length with the cursor at the
|
* clicking beyond the line length with the cursor at the
|
||||||
* end of the line. */
|
* end of the line. */
|
||||||
if (sameline && new_current_x == openfile->current_x)
|
if (sameline && openfile->current_x == current_x_save)
|
||||||
do_mark();
|
do_mark();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
openfile->current_x = new_current_x;
|
|
||||||
openfile->placewewant = xplustabs();
|
|
||||||
|
|
||||||
edit_redraw(current_save, pww_save);
|
edit_redraw(current_save, pww_save);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue