aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-07-16 23:48:58 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-08-02 12:00:00 -0400
commitc207886bdf9c4545d48837c968091b1384569562 (patch)
tree0a66a9cd0e80419b61aedb586696909838d8fd0f /src
parent521d571992e580f9b87449c5f19bc72818cbb8e1 (diff)
downloadrneovim-c207886bdf9c4545d48837c968091b1384569562.tar.gz
rneovim-c207886bdf9c4545d48837c968091b1384569562.tar.bz2
rneovim-c207886bdf9c4545d48837c968091b1384569562.zip
vim-patch:8.1.2172: spell highlight is wrong at start of the line
Problem: Spell highlight is wrong at start of the line. Solution: Fix setting the "v" variable. (closes vim/vim#5078) https://github.com/vim/vim/commit/7751d1d1a3d447d0d48f57f34e0da9f7c6ac433d Skip spell tests in OpenBSD. Nvim or screen likely crashed. Revist once issue #12104 is fixed. Skip the test for the following reasons: - unknown regression caused by https://github.com/neovim/neovim/issues/12104 - cannot revert failing test from https://github.com/neovim/neovim/commit/ed0d135247790f67ead7f1a8c21a020790e80a74
Diffstat (limited to 'src')
-rw-r--r--src/nvim/screen.c1
-rw-r--r--src/nvim/testdir/check.vim11
-rw-r--r--src/nvim/testdir/test_spell.vim41
3 files changed, 53 insertions, 0 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index 7bed747e9a..6f122442c4 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -3476,6 +3476,7 @@ win_line (
* Only do this when there is no syntax highlighting, the
* @Spell cluster is not used or the current syntax item
* contains the @Spell cluster. */
+ v = (long)(ptr - line);
if (has_spell && v >= word_end && v > cur_checked_col) {
spell_attr = 0;
if (!attr_pri) {
diff --git a/src/nvim/testdir/check.vim b/src/nvim/testdir/check.vim
new file mode 100644
index 0000000000..57a8eb57b8
--- /dev/null
+++ b/src/nvim/testdir/check.vim
@@ -0,0 +1,11 @@
+source shared.vim
+source term_util.vim
+
+" Command to check that making screendumps is supported.
+" Caller must source screendump.vim
+command CheckScreendump call CheckScreendump()
+func CheckScreendump()
+ if !CanRunVimInTerminal()
+ throw 'Skipped: cannot make screendumps'
+ endif
+endfunc
diff --git a/src/nvim/testdir/test_spell.vim b/src/nvim/testdir/test_spell.vim
index e5eaa01e92..414c7278eb 100644
--- a/src/nvim/testdir/test_spell.vim
+++ b/src/nvim/testdir/test_spell.vim
@@ -1,10 +1,13 @@
" Test spell checking
" Note: this file uses latin1 encoding, but is used with utf-8 encoding.
+source check.vim
if !has('spell')
finish
endif
+source screendump.vim
+
func TearDown()
set nospell
call delete('Xtest.aff')
@@ -477,6 +480,44 @@ func RunGoodBad(good, bad, expected_words, expected_bad_words)
bwipe!
endfunc
+func Test_spell_screendump()
+ CheckScreendump
+
+ let lines =<< trim END
+ call setline(1, [
+ \ "This is some text without any spell errors. Everything",
+ \ "should just be black, nothing wrong here.",
+ \ "",
+ \ "This line has a sepll error. and missing caps.",
+ \ "And and this is the the duplication.",
+ \ "with missing caps here.",
+ \ ])
+ set spell spelllang=en_nz
+ END
+ call writefile(lines, 'XtestSpell')
+ let buf = RunVimInTerminal('-S XtestSpell', {'rows': 8})
+ call VerifyScreenDump(buf, 'Test_spell_1', {})
+
+ let lines =<< trim END
+ call setline(1, [
+ \ "This is some text without any spell errors. Everything",
+ \ "should just be black, nothing wrong here.",
+ \ "",
+ \ "This line has a sepll error. and missing caps.",
+ \ "And and this is the the duplication.",
+ \ "with missing caps here.",
+ \ ])
+ set spell spelllang=en_nz
+ END
+ call writefile(lines, 'XtestSpell')
+ let buf = RunVimInTerminal('-S XtestSpell', {'rows': 8})
+ call VerifyScreenDump(buf, 'Test_spell_1', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+ call delete('XtestSpell')
+endfunc
+
let g:test_data_aff1 = [
\"SET ISO8859-1",
\"TRY esianrtolcdugmphbyfvkwjkqxz-\xEB\xE9\xE8\xEA\xEF\xEE\xE4\xE0\xE2\xF6\xFC\xFB'ESIANRTOLCDUGMPHBYFVKWJKQXZ",