From ee94eecbd4ce9ec3b4371bbe1a2b3cc24cf315d4 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 4 Oct 2018 19:35:04 +0200 Subject: vim-patch:8.1.0448: cursorline not removed when using 'cursorbind' Problem: Cursorline not removed when using 'cursorbind'. (Justin Keyes) Solution: Store the last cursor line per window. (closes vim/vim#3488) https://github.com/vim/vim/commit/4a5abbd6138240d109278fe1f0b45489d22f712d --- test/functional/ui/highlight_spec.lua | 65 ++++++++++++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua index 7f3bf3e97b..4a792c665c 100644 --- a/test/functional/ui/highlight_spec.lua +++ b/test/functional/ui/highlight_spec.lua @@ -677,6 +677,7 @@ end) describe('CursorLine highlight', function() before_each(clear) + it('overridden by Error, ColorColumn if fg not set', function() local screen = Screen.new(50,5) screen:set_default_attr_ids({ @@ -690,9 +691,9 @@ describe('CursorLine highlight', function() }) screen:attach() - feed_command('filetype on') - feed_command('syntax on') - feed_command('set cursorline ft=json') + command('filetype on') + command('syntax on') + command('set cursorline ft=json') feed('i{"a" : abc // 10;}') screen:expect([[ {1:{} | @@ -702,7 +703,7 @@ describe('CursorLine highlight', function() | ]]) - feed_command('set colorcolumn=3') + command('set colorcolumn=3') feed('i ') screen:expect([[ {1:{} {7: } | @@ -712,6 +713,62 @@ describe('CursorLine highlight', function() | ]]) end) + + it('with split-windows in diff-mode', function() + local screen = Screen.new(50,12) + screen:set_default_attr_ids({ + [1] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.WebGray}, + [2] = {bold = true, background = Screen.colors.Red}, + [3] = {background = Screen.colors.LightMagenta}, + [4] = {reverse = true}, + [5] = {background = Screen.colors.LightBlue}, + [6] = {background = Screen.colors.LightCyan1, bold = true, foreground = Screen.colors.Blue1}, + [7] = {background = Screen.colors.Red, foreground = Screen.colors.White}, + [8] = {bold = true, foreground = Screen.colors.Blue1}, + [9] = {bold = true, reverse = true}, + [10] = {bold = true}, + }) + screen:attach() + + command('hi CursorLine ctermbg=red ctermfg=white guibg=red guifg=white') + command('set cursorline') + feed('iline 1 some textline 2 more textextra line!extra line!last line ...') + feed('gg') + command('vsplit') + command('enew') + feed('iline 1 some textline 2 moRe text!extra line!extra line!extra line!last line ...') + feed('gg') + command('windo diffthis') + screen:expect([[ + {1: }{7:line 1 some text }{4:│}{1: }{7:^line 1 some text }| + {1: }{3:line 2 mo}{2:Re text!}{3: }{4:│}{1: }{3:line 2 mo}{2:re text}{3: }| + {1: }{5:extra line! }{4:│}{1: }{6:----------------------}| + {1: }extra line! {4:│}{1: }extra line! | + {1: }extra line! {4:│}{1: }extra line! | + {1: }last line ... {4:│}{1: }last line ... | + {1: } {4:│}{1: } | + {1: }{8:~ }{4:│}{1: }{8:~ }| + {1: }{8:~ }{4:│}{1: }{8:~ }| + {1: }{8:~ }{4:│}{1: }{8:~ }| + {4:[No Name] [+] }{9:[No Name] [+] }| + | + ]]) + feed('jjjjj') + screen:expect([[ + {1: }line 1 some text {4:│}{1: }line 1 some text | + {1: }{3:line 2 mo}{2:Re text!}{3: }{4:│}{1: }{3:line 2 mo}{2:re text}{3: }| + {1: }{5:extra line! }{4:│}{1: }{6:----------------------}| + {1: }extra line! {4:│}{1: }extra line! | + {1: }extra line! {4:│}{1: }extra line! | + {1: }last line ... {4:│}{1: }last line ... | + {1: }{7: }{4:│}{1: }{7:^ }| + {1: }{8:~ }{4:│}{1: }{8:~ }| + {1: }{8:~ }{4:│}{1: }{8:~ }| + {1: }{8:~ }{4:│}{1: }{8:~ }| + {4:[No Name] [+] }{9:[No Name] [+] }| + | + ]]) + end) end) -- cgit