# HG changeset patch # User Christian Brabandt # Date 1457796604 -3600 # Node ID 9f5bd031530d829262abac038244bfa7f3057abb # Parent 10f405d5daba5ec71926bb26ca40687c9096fe30 commit https://github.com/vim/vim/commit/b4ebf9ae3b93d082ab3b9f4aab2f6729f77fa46a Author: Bram Moolenaar Date: Sat Mar 12 16:28:18 2016 +0100 patch 7.4.1545 Problem: GTK3: horizontal cursor movement in Visual selection not good. Solution: Make it work better. (Kazunobu Kuriyama) diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -650,7 +650,8 @@ gui_gtk3_should_draw_cursor(void) { unsigned int cond = 0; cond |= gui_gtk_is_blink_on(); - cond |= is_key_pressed; + if (gui.cursor_col >= gui.col) + cond |= is_key_pressed; cond |= gui.in_focus == FALSE; return cond; } @@ -686,17 +687,29 @@ draw_event(GtkWidget *widget, if (blink_mode) gui_gtk3_redraw(rect.x, rect.y, rect.width, rect.height); else - gui_redraw(rect.x, rect.y, rect.width, rect.height); + { + if (get_real_state() & VISUAL) + gui_gtk3_redraw(rect.x, rect.y, + rect.width, rect.height); + else + gui_redraw(rect.x, rect.y, rect.width, rect.height); + } } } cairo_rectangle_list_destroy(list); + if (get_real_state() & VISUAL) + { + if (gui.cursor_row == gui.row && gui.cursor_col >= gui.col) + gui_update_cursor(TRUE, TRUE); + } + cairo_paint(cr); } gui.by_signal = FALSE; /* Add the cursor to the window if necessary.*/ - if (gui_gtk3_should_draw_cursor()) + if (gui_gtk3_should_draw_cursor() && blink_mode) gui_gtk3_update_cursor(cr); return FALSE; diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -744,6 +744,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1545, +/**/ 1544, /**/ 1543,