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)
diff --git a/src/testdir/test_spell.vim b/src/testdir/test_spell.vim
index 97c7e3c..3f77695 100644
--- a/src/testdir/test_spell.vim
+++ b/src/testdir/test_spell.vim
@@ -956,13 +956,12 @@
              \ ])
        set spell spelllang=en_nz
   END
-  call writefile(lines, 'XtestSpell')
+  call writefile(lines, 'XtestSpell', 'D')
   let buf = RunVimInTerminal('-S XtestSpell', {'rows': 8})
   call VerifyScreenDump(buf, 'Test_spell_1', {})
 
   " clean up
   call StopVimInTerminal(buf)
-  call delete('XtestSpell')
 endfunc
 
 func Test_spell_screendump_spellcap()
@@ -979,7 +978,7 @@
              \ ])
        set spell spelllang=en
   END
-  call writefile(lines, 'XtestSpellCap')
+  call writefile(lines, 'XtestSpellCap', 'D')
   let buf = RunVimInTerminal('-S XtestSpellCap', {'rows': 8})
   call VerifyScreenDump(buf, 'Test_spell_2', {})
 
@@ -997,7 +996,30 @@
 
   " clean up
   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
 
 let g:test_data_aff1 = [