aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/spell_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-10-22 11:34:09 +0800
committerGitHub <noreply@github.com>2024-10-22 11:34:09 +0800
commit1b9dafa67ba98e360444832e1fddce1e96acc1d6 (patch)
treeb5466c491cdc91a73904fc870ae69c9fb637552f /test/functional/ui/spell_spec.lua
parentf663243e95f488b8f4224bdae2697ddac21d0ffb (diff)
downloadrneovim-1b9dafa67ba98e360444832e1fddce1e96acc1d6.tar.gz
rneovim-1b9dafa67ba98e360444832e1fddce1e96acc1d6.tar.bz2
rneovim-1b9dafa67ba98e360444832e1fddce1e96acc1d6.zip
fix(options): fix :setglobal not working for 'spelloptions' (#30894)
Diffstat (limited to 'test/functional/ui/spell_spec.lua')
-rw-r--r--test/functional/ui/spell_spec.lua48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/functional/ui/spell_spec.lua b/test/functional/ui/spell_spec.lua
index f0fa47ebfb..c3e01e5b6a 100644
--- a/test/functional/ui/spell_spec.lua
+++ b/test/functional/ui/spell_spec.lua
@@ -408,4 +408,52 @@ describe("'spell'", function()
{5:-- VISUAL LINE --} |
]])
end)
+
+ it("global value works properly for 'spelloptions'", function()
+ screen:try_resize(43, 3)
+ exec('set spell')
+ -- :setglobal applies to future buffers but not current buffer
+ exec('setglobal spelloptions=camel')
+ insert('Here is TheCamelWord being spellchecked')
+ screen:expect([[
+ Here is {1:TheCamelWord} being spellchecke^d |
+ {0:~ }|
+ |
+ ]])
+ exec('enew')
+ insert('There is TheCamelWord being spellchecked')
+ screen:expect([[
+ There is TheCamelWord being spellchecke^d |
+ {0:~ }|
+ |
+ ]])
+ -- :setlocal applies to current buffer but not future buffers
+ exec('setlocal spelloptions=')
+ screen:expect([[
+ There is {1:TheCamelWord} being spellchecke^d |
+ {0:~ }|
+ |
+ ]])
+ exec('enew')
+ insert('What is TheCamelWord being spellchecked')
+ screen:expect([[
+ What is TheCamelWord being spellchecke^d |
+ {0:~ }|
+ |
+ ]])
+ -- :set applies to both current buffer and future buffers
+ exec('set spelloptions=')
+ screen:expect([[
+ What is {1:TheCamelWord} being spellchecke^d |
+ {0:~ }|
+ |
+ ]])
+ exec('enew')
+ insert('Where is TheCamelWord being spellchecked')
+ screen:expect([[
+ Where is {1:TheCamelWord} being spellchecke^d |
+ {0:~ }|
+ |
+ ]])
+ end)
end)