diff options
author | Thomas Vigouroux <thomas.vigouroux@protonmail.com> | 2022-09-13 09:44:24 +0200 |
---|---|---|
committer | Lewis Russell <lewis6991@gmail.com> | 2022-11-12 10:19:01 +0000 |
commit | 7e6d785d19926714615758e75c4d43e856d13a6f (patch) | |
tree | 4fdd44a500626fd1950cd1c85b30bf370b26b26a /test | |
parent | 7335a67b5754255f0e892303a0f4e3521035e7d8 (diff) | |
download | rneovim-7e6d785d19926714615758e75c4d43e856d13a6f.tar.gz rneovim-7e6d785d19926714615758e75c4d43e856d13a6f.tar.bz2 rneovim-7e6d785d19926714615758e75c4d43e856d13a6f.zip |
feat(extmarks): allow preventing spellchecking with spell = false
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/ui/decorations_spec.lua | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index 5b62f5b3e1..489c33d8b1 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -176,7 +176,13 @@ describe('decorations providers', function() beamtrace = {} local function on_do(kind, ...) if kind == 'win' or kind == 'spell' then - a.nvim_buf_set_extmark(0, ns, 0, 0, { end_row = 2, end_col = 23, spell = true, ephemeral = true }) + a.nvim_buf_set_extmark(0, ns, 0, 0, { + end_row = 2, + end_col = 23, + spell = true, + priority = 20, + ephemeral = true + }) end table.insert(beamtrace, {kind, ...}) end @@ -234,6 +240,36 @@ describe('decorations providers', function() {1:~ }| | ]]} + + -- spell=false with lower priority doesn't disable spell + local ns = meths.create_namespace "spell" + local id = helpers.curbufmeths.set_extmark(ns, 0, 0, { priority = 30, end_row = 2, end_col = 23, spell = false }) + + screen:expect{grid=[[ + I am well written text. | + i am not capitalized. | + I am a ^speling mistakke. | + | + {1:~ }| + {1:~ }| + {1:~ }| + | + ]]} + + -- spell=false with higher priority does disable spell + helpers.curbufmeths.set_extmark(ns, 0, 0, { id = id, priority = 10, end_row = 2, end_col = 23, spell = false }) + + screen:expect{grid=[[ + I am well written text. | + {15:i} am not capitalized. | + I am a {16:^speling} {16:mistakke}. | + | + {1:~ }| + {1:~ }| + {1:~ }| + | + ]]} + end) it('can predefine highlights', function() |