]> git.wh0rd.org Git - nano.git/commitdiff
really fix mouse support breakage
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Mon, 25 Jul 2005 20:28:21 +0000 (20:28 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Mon, 25 Jul 2005 20:28:21 +0000 (20:28 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2931 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

src/nano.c

index 0d0c23ea1fe3d2933d0fe0f2849a7f762a997c52..285a082ab5995ca0721fc7dc823b37b3137604f0 100644 (file)
@@ -1727,8 +1727,7 @@ bool do_mouse(void)
                /* Did they click on the line with the cursor?  If they
                 * clicked on the cursor, we set the mark. */
            const filestruct *current_save = openfile->current;
-           size_t current_x_save = openfile->current_x;
-           size_t pww_save = openfile->placewewant;
+           size_t new_current_x, pww_save = openfile->placewewant;
 
            /* Subtract out the size of topwin. */
            mouse_y -= 2 - no_more_space();
@@ -1743,18 +1742,20 @@ bool do_mouse(void)
                openfile->current->prev != NULL; openfile->current_y--)
                openfile->current = openfile->current->prev;
 
-           openfile->current_x = actual_x(openfile->current->data,
+           new_current_x = actual_x(openfile->current->data,
                get_page_start(xplustabs() + mouse_x));
-           openfile->placewewant = xplustabs();
 
 #ifndef NANO_SMALL
            /* Clicking where the cursor is toggles the mark, as does
             * clicking beyond the line length with the cursor at the
             * end of the line. */
-           if (sameline && openfile->current_x == current_x_save)
+           if (sameline && new_current_x == openfile->current_x)
                do_mark();
 #endif
 
+           openfile->current_x = new_current_x;
+           openfile->placewewant = xplustabs();
+
            edit_redraw(current_save, pww_save);
        }
     }