mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
vim-patch:8.0.0121
Problem: Setting 'cursorline' changes the curswant column. (Daniel Hahler)
Solution: Add the P_RWINONLY flag. (closes vim/vim#1297)
a2477fd349
This commit is contained in:
parent
f686635420
commit
a0b33b333e
@ -31,6 +31,7 @@ local type_flags={
|
||||
local redraw_flags={
|
||||
statuslines='P_RSTAT',
|
||||
current_window='P_RWIN',
|
||||
current_window_only='P_RWINONLY',
|
||||
current_buffer='P_RBUF',
|
||||
all_windows='P_RALL',
|
||||
everything='P_RCLR',
|
||||
|
@ -238,6 +238,8 @@ typedef struct vimoption {
|
||||
///< when there is a redraw flag
|
||||
#define P_NO_DEF_EXP 0x8000000U ///< Do not expand default value.
|
||||
|
||||
#define P_RWINONLY 0x10000000U ///< only redraw current window
|
||||
|
||||
#define HIGHLIGHT_INIT \
|
||||
"8:SpecialKey,~:EndOfBuffer,z:TermCursor,Z:TermCursorNC,@:NonText," \
|
||||
"d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr," \
|
||||
@ -4364,6 +4366,8 @@ static void check_redraw(uint32_t flags)
|
||||
changed_window_setting();
|
||||
if (flags & P_RBUF)
|
||||
redraw_curbuf_later(NOT_VALID);
|
||||
if (flags & P_RWINONLY)
|
||||
redraw_later(NOT_VALID);
|
||||
if (doclear)
|
||||
redraw_all_later(CLEAR);
|
||||
else if (all)
|
||||
|
@ -17,8 +17,8 @@
|
||||
-- types: bool, number, string
|
||||
-- lists: (nil), comma, onecomma, flags, flagscomma
|
||||
-- scopes: global, buffer, window
|
||||
-- redraw options: statuslines, current_window, current_buffer, all_windows,
|
||||
-- everything, curswant
|
||||
-- redraw options: statuslines, current_window, curent_window_only,
|
||||
-- current_buffer, all_windows, everything, curswant
|
||||
-- default: {vi=…[, vim=…]}
|
||||
-- defaults: {condition=#if condition, if_true=default, if_false=default}
|
||||
-- #if condition:
|
||||
@ -539,7 +539,7 @@ return {
|
||||
full_name='cursorline', abbreviation='cul',
|
||||
type='bool', scope={'window'},
|
||||
vi_def=true,
|
||||
redraw={'current_window'},
|
||||
redraw={'current_window_only'},
|
||||
defaults={if_true={vi=false}}
|
||||
},
|
||||
{
|
||||
|
@ -18,3 +18,18 @@ func Test_gee_dee()
|
||||
call assert_equal(14, col('.'))
|
||||
quit!
|
||||
endfunc
|
||||
|
||||
" Check that setting 'cursorline' does not change curswant
|
||||
func Test_cursorline_keep_col()
|
||||
new
|
||||
call setline(1, ['long long long line', 'short line'])
|
||||
normal ggfi
|
||||
let pos = getcurpos()
|
||||
normal j
|
||||
set cursorline
|
||||
normal k
|
||||
call assert_equal(pos, getcurpos())
|
||||
bwipe!
|
||||
set nocursorline
|
||||
endfunc
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user