Skip to content

Commit b4ebf9a

Browse files
committed
patch 7.4.1545
Problem: GTK3: horizontal cursor movement in Visual selection not good. Solution: Make it work better. (Kazunobu Kuriyama)
1 parent 583c1f1 commit b4ebf9a

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

src/gui_gtk_x11.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,8 @@ gui_gtk3_should_draw_cursor(void)
650650
{
651651
unsigned int cond = 0;
652652
cond |= gui_gtk_is_blink_on();
653-
cond |= is_key_pressed;
653+
if (gui.cursor_col >= gui.col)
654+
cond |= is_key_pressed;
654655
cond |= gui.in_focus == FALSE;
655656
return cond;
656657
}
@@ -686,17 +687,29 @@ draw_event(GtkWidget *widget,
686687
if (blink_mode)
687688
gui_gtk3_redraw(rect.x, rect.y, rect.width, rect.height);
688689
else
689-
gui_redraw(rect.x, rect.y, rect.width, rect.height);
690+
{
691+
if (get_real_state() & VISUAL)
692+
gui_gtk3_redraw(rect.x, rect.y,
693+
rect.width, rect.height);
694+
else
695+
gui_redraw(rect.x, rect.y, rect.width, rect.height);
696+
}
690697
}
691698
}
692699
cairo_rectangle_list_destroy(list);
693700

701+
if (get_real_state() & VISUAL)
702+
{
703+
if (gui.cursor_row == gui.row && gui.cursor_col >= gui.col)
704+
gui_update_cursor(TRUE, TRUE);
705+
}
706+
694707
cairo_paint(cr);
695708
}
696709
gui.by_signal = FALSE;
697710

698711
/* Add the cursor to the window if necessary.*/
699-
if (gui_gtk3_should_draw_cursor())
712+
if (gui_gtk3_should_draw_cursor() && blink_mode)
700713
gui_gtk3_update_cursor(cr);
701714

702715
return FALSE;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,8 @@ static char *(features[]) =
743743

744744
static int included_patches[] =
745745
{ /* Add new patch number below this line */
746+
/**/
747+
1545,
746748
/**/
747749
1544,
748750
/**/

0 commit comments

Comments
 (0)