forked from aniani/vim
patch 9.0.0664: bad redrawing with spell checking, using "C" and "$" in 'cpo'
Problem: Bad redrawing with spell checking, using "C" and "$" in 'cpo'. Solution: Do not redraw the next line when "$" is in 'cpo'. (closes #11285)
This commit is contained in:
@@ -713,7 +713,10 @@ changed_bytes(linenr_T lnum, colnr_T col)
|
|||||||
// When text has been changed at the end of the line, possibly the start of
|
// When text has been changed at the end of the line, possibly the start of
|
||||||
// the next line may have SpellCap that should be removed or it needs to be
|
// the next line may have SpellCap that should be removed or it needs to be
|
||||||
// displayed. Schedule the next line for redrawing just in case.
|
// displayed. Schedule the next line for redrawing just in case.
|
||||||
if (spell_check_window(curwin) && lnum < curbuf->b_ml.ml_line_count)
|
// Don't do this when displaying '$' at the end of changed text.
|
||||||
|
if (spell_check_window(curwin)
|
||||||
|
&& lnum < curbuf->b_ml.ml_line_count
|
||||||
|
&& vim_strchr(p_cpo, CPO_DOLLAR) == NULL)
|
||||||
redrawWinline(curwin, lnum + 1);
|
redrawWinline(curwin, lnum + 1);
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_DIFF
|
#ifdef FEAT_DIFF
|
||||||
|
@@ -1738,8 +1738,8 @@ edit_unputchar(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Called when p_dollar is set: display a '$' at the end of the changed text
|
* Called when "$" is in 'cpoptions': display a '$' at the end of the changed
|
||||||
* Only works when cursor is in the line that changes.
|
* text. Only works when cursor is in the line that changes.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
display_dollar(colnr_T col_arg)
|
display_dollar(colnr_T col_arg)
|
||||||
|
8
src/testdir/dumps/Test_spell_compatible_1.dump
Normal file
8
src/testdir/dumps/Test_spell_compatible_1.dump
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
|t+0fd7ff255|e|s|t| +0&#ffffff0|t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| >t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t|
|
||||||
|
|t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t|$| @49
|
||||||
|
@75
|
||||||
|
|e+0fd7ff255|n|d| +0&#ffffff0@71
|
||||||
|
|~+0#4040ff13&| @73
|
||||||
|
|~| @73
|
||||||
|
|~| @73
|
||||||
|
|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|1|,|5|1| @9|A|l@1|
|
8
src/testdir/dumps/Test_spell_compatible_2.dump
Normal file
8
src/testdir/dumps/Test_spell_compatible_2.dump
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
|t+0fd7ff255|e|s|t| +0&#ffffff0|t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |x>e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t|
|
||||||
|
|t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t|$| @49
|
||||||
|
@75
|
||||||
|
|e+0fd7ff255|n|d| +0&#ffffff0@71
|
||||||
|
|~+0#4040ff13&| @73
|
||||||
|
|~| @73
|
||||||
|
|~| @73
|
||||||
|
|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|1|,|5|2| @9|A|l@1|
|
@@ -956,13 +956,12 @@ func Test_spell_screendump()
|
|||||||
\ ])
|
\ ])
|
||||||
set spell spelllang=en_nz
|
set spell spelllang=en_nz
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XtestSpell')
|
call writefile(lines, 'XtestSpell', 'D')
|
||||||
let buf = RunVimInTerminal('-S XtestSpell', {'rows': 8})
|
let buf = RunVimInTerminal('-S XtestSpell', {'rows': 8})
|
||||||
call VerifyScreenDump(buf, 'Test_spell_1', {})
|
call VerifyScreenDump(buf, 'Test_spell_1', {})
|
||||||
|
|
||||||
" clean up
|
" clean up
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XtestSpell')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_spell_screendump_spellcap()
|
func Test_spell_screendump_spellcap()
|
||||||
@@ -979,7 +978,7 @@ func Test_spell_screendump_spellcap()
|
|||||||
\ ])
|
\ ])
|
||||||
set spell spelllang=en
|
set spell spelllang=en
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XtestSpellCap')
|
call writefile(lines, 'XtestSpellCap', 'D')
|
||||||
let buf = RunVimInTerminal('-S XtestSpellCap', {'rows': 8})
|
let buf = RunVimInTerminal('-S XtestSpellCap', {'rows': 8})
|
||||||
call VerifyScreenDump(buf, 'Test_spell_2', {})
|
call VerifyScreenDump(buf, 'Test_spell_2', {})
|
||||||
|
|
||||||
@@ -997,7 +996,30 @@ func Test_spell_screendump_spellcap()
|
|||||||
|
|
||||||
" clean up
|
" clean up
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XtestSpellCap')
|
endfunc
|
||||||
|
|
||||||
|
func Test_spell_compatible()
|
||||||
|
CheckScreendump
|
||||||
|
|
||||||
|
let lines =<< trim END
|
||||||
|
call setline(1, [
|
||||||
|
\ "test "->repeat(20),
|
||||||
|
\ "",
|
||||||
|
\ "end",
|
||||||
|
\ ])
|
||||||
|
set spell cpo+=$
|
||||||
|
END
|
||||||
|
call writefile(lines, 'XtestSpellComp', 'D')
|
||||||
|
let buf = RunVimInTerminal('-S XtestSpellComp', {'rows': 8})
|
||||||
|
|
||||||
|
call term_sendkeys(buf, "51|C")
|
||||||
|
call VerifyScreenDump(buf, 'Test_spell_compatible_1', {})
|
||||||
|
|
||||||
|
call term_sendkeys(buf, "x")
|
||||||
|
call VerifyScreenDump(buf, 'Test_spell_compatible_2', {})
|
||||||
|
|
||||||
|
" clean up
|
||||||
|
call StopVimInTerminal(buf)
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
let g:test_data_aff1 = [
|
let g:test_data_aff1 = [
|
||||||
|
@@ -699,6 +699,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
664,
|
||||||
/**/
|
/**/
|
||||||
663,
|
663,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user