mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
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 #5078)
This commit is contained in:
parent
a1cb1d1dce
commit
7751d1d1a3
@ -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.
|
||||
|
8
src/testdir/dumps/Test_spell_1.dump
Normal file
8
src/testdir/dumps/Test_spell_1.dump
Normal file
@ -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|
|
@ -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",
|
||||
|
@ -741,6 +741,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2172,
|
||||
/**/
|
||||
2171,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user