diff options
author | Daniel Hahler <git@thequod.de> | 2019-09-26 09:15:21 +0200 |
---|---|---|
committer | Daniel Hahler <git@thequod.de> | 2019-10-04 08:54:02 +0200 |
commit | 56d94129995a6ac008ee7461afb39af8a6a92028 (patch) | |
tree | a0ea985fe5f2ebe01173d280ac608ef98977d71b /src | |
parent | ddd3363a428bad302f517fe5d433ce61b2b8de6c (diff) | |
download | rneovim-56d94129995a6ac008ee7461afb39af8a6a92028.tar.gz rneovim-56d94129995a6ac008ee7461afb39af8a6a92028.tar.bz2 rneovim-56d94129995a6ac008ee7461afb39af8a6a92028.zip |
[release-0.4] win_line: update `w_last_cursorline` always
Vim patch 8.1.0856 (54d9ea6) caused a performance regression in Neovim,
when `set conceallevel=1 nocursorline` was used, since then due to
refactoring in 23c71d5 `w_last_cursorline` would never get updated
anymore.
Adds/uses `redrawdebug+=nodelta` for testing this.
Fixes https://github.com/neovim/neovim/issues/11100.
Closes https://github.com/neovim/neovim/pull/11101.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/option.c | 4 | ||||
-rw-r--r-- | src/nvim/option_defs.h | 9 | ||||
-rw-r--r-- | src/nvim/screen.c | 8 |
3 files changed, 16 insertions, 5 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 3ccc67eb14..22f7b85133 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -4306,6 +4306,10 @@ static char *set_num_option(int opt_idx, char_u *varp, long value, if (value < 0) { errmsg = e_positive; } + } else if (pp == &p_wd) { + if (value < 0) { + errmsg = e_positive; + } } // Don't change the value and return early if validation failed. diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h index 108a3dde7c..67cb53ce02 100644 --- a/src/nvim/option_defs.h +++ b/src/nvim/option_defs.h @@ -518,11 +518,18 @@ EXTERN long p_pyx; // 'pyxversion' EXTERN char_u *p_rdb; // 'redrawdebug' EXTERN unsigned rdb_flags; # ifdef IN_OPTION_C -static char *(p_rdb_values[]) = { "compositor", "nothrottle", "invalid", NULL }; +static char *(p_rdb_values[]) = { + "compositor", + "nothrottle", + "invalid", + "nodelta", + NULL +}; # endif # define RDB_COMPOSITOR 0x001 # define RDB_NOTHROTTLE 0x002 # define RDB_INVALID 0x004 +# define RDB_NODELTA 0x008 EXTERN long p_rdt; // 'redrawtime' EXTERN int p_remap; // 'remap' diff --git a/src/nvim/screen.c b/src/nvim/screen.c index c6b562cc8b..a856534c20 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -577,7 +577,7 @@ void conceal_check_cursor_line(void) /// Whether cursorline is drawn in a special way /// /// If true, both old and new cursorline will need -/// need to be redrawn when moving cursor within windows. +/// to be redrawn when moving cursor within windows. /// TODO(bfredl): VIsual_active shouldn't be needed, but is used to fix a glitch /// caused by scrolling. bool win_cursorline_standout(const win_T *wp) @@ -2406,10 +2406,10 @@ win_line ( filler_todo = filler_lines; // Cursor line highlighting for 'cursorline' in the current window. - if (wp->w_p_cul && lnum == wp->w_cursor.lnum) { + if (lnum == wp->w_cursor.lnum) { // Do not show the cursor line when Visual mode is active, because it's // not clear what is selected then. - if (!(wp == curwin && VIsual_active)) { + if (wp->w_p_cul && !(wp == curwin && VIsual_active)) { int cul_attr = win_hl_attr(wp, HLF_CUL); HlAttrs ae = syn_attr2entry(cul_attr); @@ -4356,7 +4356,7 @@ static int grid_char_needs_redraw(ScreenGrid *grid, int off_from, int off_to, || (line_off2cells(linebuf_char, off_from, off_from + cols) > 1 && schar_cmp(linebuf_char[off_from + 1], grid->chars[off_to + 1]))) - || p_wd < 0)); + || rdb_flags & RDB_NODELTA)); } /// Move one buffered line to the window grid, but only the characters that |