aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorluukvbaal <luukvbaal@gmail.com>2023-05-26 02:08:18 +0200
committerGitHub <noreply@github.com>2023-05-26 08:08:18 +0800
commitf733595e795cd2b819cb8fd18327cd51f47b2124 (patch)
tree280a35641132753495e4720ff95b9a7358d75dfe /test
parentee986ee0449b828ca64bf7d4c69624596aab8319 (diff)
downloadrneovim-f733595e795cd2b819cb8fd18327cd51f47b2124.tar.gz
rneovim-f733595e795cd2b819cb8fd18327cd51f47b2124.tar.bz2
rneovim-f733595e795cd2b819cb8fd18327cd51f47b2124.zip
vim-patch:9.0.1578: SpellCap highlight not always updated when needed (#23755)
Problem: SpellCap highlight not always updated when needed. Solution: Handle updating line below closed fold and other situations where only part of the window is redrawn. (Luuk van Baal, closes vim/vim#12428, closes vim/vim#12420) https://github.com/vim/vim/commit/2ac6497f0ef186f0e3ba67d7f0a485bfb612bb08
Diffstat (limited to 'test')
-rw-r--r--test/functional/ui/spell_spec.lua42
-rw-r--r--test/old/testdir/test_spell.vim15
2 files changed, 54 insertions, 3 deletions
diff --git a/test/functional/ui/spell_spec.lua b/test/functional/ui/spell_spec.lua
index 7f11b06f78..630d0d0948 100644
--- a/test/functional/ui/spell_spec.lua
+++ b/test/functional/ui/spell_spec.lua
@@ -28,6 +28,7 @@ describe("'spell'", function()
[7] = {foreground = Screen.colors.Blue},
[8] = {foreground = Screen.colors.Blue, special = Screen.colors.Red, undercurl = true},
[9] = {bold = true},
+ [10] = {background = Screen.colors.LightGrey, foreground = Screen.colors.DarkBlue},
})
end)
@@ -82,7 +83,7 @@ describe("'spell'", function()
end)
-- oldtest: Test_spell_screendump_spellcap()
- it('has correct highlight at start of line with trailing space', function()
+ it('SpellCap highlight at start of line', function()
exec([=[
call setline(1, [
\" This line has a sepll error. and missing caps and trailing spaces. ",
@@ -117,7 +118,7 @@ describe("'spell'", function()
|
]])
-- Deleting a full stop removes missing Cap in next line
- feed('5Gddk$x')
+ feed('5Gdd<C-L>k$x')
screen:expect([[
This line has a {1:sepll} error. {2:and} missing caps and trailing spaces. |
{2:another} missing cap here. |
@@ -140,6 +141,43 @@ describe("'spell'", function()
{0:~ }|
|
]])
+ -- Folding an empty line does not remove Cap in next line
+ feed('uzfk:<Esc>')
+ screen:expect([[
+ This line has a {1:sepll} error. {2:and} missing caps and trailing spaces. |
+ {2:another} missing cap here. |
+ Not |
+ {10:^+-- 2 lines: and here.·························································}|
+ {2:and} here. |
+ {0:~ }|
+ {0:~ }|
+ |
+ ]])
+ -- Folding the end of a sentence does not remove Cap in next line
+ -- and editing a line does not remove Cap in current line
+ feed('Jzfkk$x')
+ screen:expect([[
+ This line has a {1:sepll} error. {2:and} missing caps and trailing spaces. |
+ {2:another} missing cap her^e |
+ {10:+-- 2 lines: Not·······························································}|
+ {2:and} here. |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ |
+ ]])
+ -- Cap is correctly applied in the first row of a window
+ feed('<C-E><C-L>')
+ screen:expect([[
+ {2:another} missing cap her^e |
+ {10:+-- 2 lines: Not·······························································}|
+ {2:and} here. |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ |
+ ]])
end)
-- oldtest: Test_spell_compatible()
diff --git a/test/old/testdir/test_spell.vim b/test/old/testdir/test_spell.vim
index 14d6ce30c4..b0b2668758 100644
--- a/test/old/testdir/test_spell.vim
+++ b/test/old/testdir/test_spell.vim
@@ -1003,13 +1003,26 @@ func Test_spell_screendump_spellcap()
call VerifyScreenDump(buf, 'Test_spell_3', {})
" Deleting a full stop removes missing Cap in next line
- call term_sendkeys(buf, "5Gddk$x")
+ call term_sendkeys(buf, "5Gdd\<C-L>k$x")
call VerifyScreenDump(buf, 'Test_spell_4', {})
" Undo also updates the next line (go to command line to remove message)
call term_sendkeys(buf, "u:\<Esc>")
call VerifyScreenDump(buf, 'Test_spell_5', {})
+ " Folding an empty line does not remove Cap in next line
+ call term_sendkeys(buf, "uzfk:\<Esc>")
+ call VerifyScreenDump(buf, 'Test_spell_6', {})
+
+ " Folding the end of a sentence does not remove Cap in next line
+ " and editing a line does not remove Cap in current line
+ call term_sendkeys(buf, "Jzfkk$x")
+ call VerifyScreenDump(buf, 'Test_spell_7', {})
+
+ " Cap is correctly applied in the first row of a window
+ call term_sendkeys(buf, "\<C-E>\<C-L>")
+ call VerifyScreenDump(buf, 'Test_spell_8', {})
+
" clean up
call StopVimInTerminal(buf)
endfunc