diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-10-18 20:37:08 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-10-18 20:37:08 +0200 |
commit | 7751d1d1a3d447d0d48f57f34e0da9f7c6ac433d (patch) | |
tree | a66d9b1b9a6ad27a836452205e4b989ccd3dc71c | |
parent | a1cb1d1dce14dd005797590721f1bcd0e7c3b35f (diff) | |
download | vim-git-7751d1d1a3d447d0d48f57f34e0da9f7c6ac433d.tar.gz |
patch 8.1.2172: spell highlight is wrong at start of the linev8.1.2172
Problem: Spell highlight is wrong at start of the line.
Solution: Fix setting the "v" variable. (closes #5078)
-rw-r--r-- | src/drawline.c | 4 | ||||
-rw-r--r-- | src/testdir/dumps/Test_spell_1.dump | 8 | ||||
-rw-r--r-- | src/testdir/test_spell.vim | 25 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 38 insertions, 1 deletions
diff --git a/src/drawline.c b/src/drawline.c index 9a4ff7dc5..333eeba29 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -1824,6 +1824,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; @@ -1874,7 +1875,8 @@ win_line( // Remember that the good word continues at the // start of the next line. checked_lnum = lnum + 1; - checked_col = (int)((p - nextline) + len - nextline_idx); + checked_col = (int)((p - nextline) + + len - nextline_idx); } // Turn index into actual attributes. diff --git a/src/testdir/dumps/Test_spell_1.dump b/src/testdir/dumps/Test_spell_1.dump new file mode 100644 index 000000000..2025be18e --- /dev/null +++ b/src/testdir/dumps/Test_spell_1.dump @@ -0,0 +1,8 @@ +>T+0&#ffffff0|h|i|s| |i|s| |s|o|m|e| |t|e|x|t| |w|i|t|h|o|u|t| |a|n|y| |s|p|e|l@1| |e|r@1|o|r|s|.| @1|E|v|e|r|y|t|h|i|n|g| @19 +|s|h|o|u|l|d| |j|u|s|t| |b|e| |b|l|a|c|k|,| |n|o|t|h|i|n|g| |w|r|o|n|g| |h|e|r|e|.| @33 +@75 +|T|h|i|s| |l|i|n|e| |h|a|s| |a| |s+0&#ffd7d7255|e|p|l@1| +0&#ffffff0|e|r@1|o|r|.| |a+0fd7ff255|n|d| +0&#ffffff0|m|i|s@1|i|n|g| |c|a|p|s|.| @28 +|A+0&#ffd7d7255|n|d| |a|n|d| +0&#ffffff0|t|h|i|s| |i|s| |t+0&#ffd7d7255|h|e| |t|h|e| +0&#ffffff0|d|u|p|l|i|c|a|t|i|o|n|.| @38 +|w+0fd7ff255|i|t|h| +0&#ffffff0|m|i|s@1|i|n|g| |c|a|p|s| |h|e|r|e|.| @51 +|~+0#4040ff13&| @73 +| +0#0000000&@56|1|,|1| @10|A|l@1| diff --git a/src/testdir/test_spell.vim b/src/testdir/test_spell.vim index 9cbfaa50e..146e421d0 100644 --- a/src/testdir/test_spell.vim +++ b/src/testdir/test_spell.vim @@ -4,6 +4,8 @@ source check.vim CheckFeature spell +source screendump.vim + func TearDown() set nospell call delete('Xtest.aff') @@ -460,6 +462,29 @@ 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', {}) + + " 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", diff --git a/src/version.c b/src/version.c index 0dd36774d..901bf32cc 100644 --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2172, +/**/ 2171, /**/ 2170, |