summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-08-12 14:08:25 +0200
committerBram Moolenaar <Bram@vim.org>2016-08-12 14:08:25 +0200
commit107abd2ca53c31fd3bb40d77ff296e98eaae2975 (patch)
treeec1ae0386ed26e1ea96291a69ddf47f9b7aef854
parent0e5d3a2940ead6c8ee3bacacea4153b647b67cca (diff)
downloadvim-git-107abd2ca53c31fd3bb40d77ff296e98eaae2975.tar.gz
patch 7.4.2199v7.4.2199
Problem: In the GUI the cursor is hidden when redrawing any window, causing flicker. Solution: Only undraw the cursor when updating the window it's in.
-rw-r--r--src/gui.c5
-rw-r--r--src/gui_gtk_x11.c2
-rw-r--r--src/proto/gui.pro2
-rw-r--r--src/screen.c19
-rw-r--r--src/version.c2
5 files changed, 18 insertions, 12 deletions
diff --git a/src/gui.c b/src/gui.c
index 0d858ec5b..6f1d8f51b 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -1964,12 +1964,13 @@ gui_write(
* gui_can_update_cursor() afterwards.
*/
void
-gui_dont_update_cursor(void)
+gui_dont_update_cursor(int undraw)
{
if (gui.in_use)
{
/* Undraw the cursor now, we probably can't do it after the change. */
- gui_undraw_cursor();
+ if (undraw)
+ gui_undraw_cursor();
can_update_cursor = FALSE;
}
}
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 7c63a49fc..a53fa12d2 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -6698,7 +6698,7 @@ check_copy_area(void)
* we don't want it to be. I'm not sure if it's correct to call
* gui_dont_update_cursor() at this point but it works as a quick
* fix for now. */
- gui_dont_update_cursor();
+ gui_dont_update_cursor(TRUE);
do
{
diff --git a/src/proto/gui.pro b/src/proto/gui.pro
index 7a0176f5b..26466ae02 100644
--- a/src/proto/gui.pro
+++ b/src/proto/gui.pro
@@ -23,7 +23,7 @@ void gui_stop_highlight(int mask);
void gui_clear_block(int row1, int col1, int row2, int col2);
void gui_update_cursor_later(void);
void gui_write(char_u *s, int len);
-void gui_dont_update_cursor(void);
+void gui_dont_update_cursor(int undraw);
void gui_can_update_cursor(void);
int gui_outstr_nowrap(char_u *s, int len, int flags, guicolor_T fg, guicolor_T bg, int back);
void gui_undraw_cursor(void);
diff --git a/src/screen.c b/src/screen.c
index f8d283fa2..0458ed780 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -498,6 +498,7 @@ update_screen(int type)
int did_one;
#endif
#ifdef FEAT_GUI
+ int did_undraw = FALSE;
int gui_cursor_col;
int gui_cursor_row;
#endif
@@ -697,11 +698,12 @@ update_screen(int type)
/* Remove the cursor before starting to do anything, because
* scrolling may make it difficult to redraw the text under
* it. */
- if (gui.in_use)
+ if (gui.in_use && wp == curwin)
{
gui_cursor_col = gui.cursor_col;
gui_cursor_row = gui.cursor_row;
gui_undraw_cursor();
+ did_undraw = TRUE;
}
#endif
}
@@ -757,7 +759,7 @@ update_screen(int type)
if (gui.in_use)
{
out_flush(); /* required before updating the cursor */
- if (did_one && !gui_mch_is_blink_off())
+ if (did_undraw && !gui_mch_is_blink_off())
{
/* Put the GUI position where the cursor was, gui_update_cursor()
* uses that. */
@@ -9679,7 +9681,7 @@ screen_ins_lines(
#ifdef FEAT_GUI
/* Don't update the GUI cursor here, ScreenLines[] is invalid until the
* scrolling is actually carried out. */
- gui_dont_update_cursor();
+ gui_dont_update_cursor(row + off <= gui.cursor_row);
#endif
if (*T_CCS != NUL) /* cursor relative to region */
@@ -9781,10 +9783,10 @@ screen_ins_lines(
}
/*
- * delete lines on the screen and update ScreenLines[]
- * 'end' is the line after the scrolled part. Normally it is Rows.
- * When scrolling region used 'off' is the offset from the top for the region.
- * 'row' and 'end' are relative to the start of the region.
+ * Delete lines on the screen and update ScreenLines[].
+ * "end" is the line after the scrolled part. Normally it is Rows.
+ * When scrolling region used "off" is the offset from the top for the region.
+ * "row" and "end" are relative to the start of the region.
*
* Return OK for success, FAIL if the lines are not deleted.
*/
@@ -9900,7 +9902,8 @@ screen_del_lines(
#ifdef FEAT_GUI
/* Don't update the GUI cursor here, ScreenLines[] is invalid until the
* scrolling is actually carried out. */
- gui_dont_update_cursor();
+ gui_dont_update_cursor(gui.cursor_row >= row + off
+ && gui.cursor_row < end + off);
#endif
if (*T_CCS != NUL) /* cursor relative to region */
diff --git a/src/version.c b/src/version.c
index 4f96443ba..b324c12aa 100644
--- a/src/version.c
+++ b/src/version.c
@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2199,
+/**/
2198,
/**/
2197,