@@ -110,6 +110,7 @@ endfunc
110110func Test_cursorline_screenline ()
111111 CheckScreendump
112112 CheckOption cursorlineopt
113+
113114 let filename= ' Xcursorline'
114115 let lines = []
115116
@@ -197,4 +198,52 @@ func Test_cursorline_screenline()
197198 call delete (filename)
198199endfunc
199200
201+ func Test_cursorline_redraw ()
202+ CheckScreendump
203+ CheckOption cursorlineopt
204+
205+ let textlines = << END
206+ When the option is a list of flags, {value} must be
207+ exactly as they appear in the option . Remove flags
208+ one by one to avoid problems.
209+ Also see |:set - args | above.
210+
211+ The {option } arguments to " :set" may be repeated. For example: >
212+ :set ai nosi sw = 3 ts = 3
213+ If you make an error in one of the arguments, an error message will be given
214+ and the following arguments will be ignored.
215+
216+ * :set - verbose *
217+ When ' verbose' is non- zero, displaying an option value will also tell where it
218+ was last set . Example: >
219+ :verbose set shiftwidth cindent ?
220+ < shiftwidth = 4 ~
221+ Last set from modeline line 1 ~
222+ cindent ~
223+ Last set from /usr/ local/share/ vim /vim60/ ftplugin/c .vim line 30 ~
224+ This is only done when specific option values are requested, not for " :verbose
225+ set all " or " :verbose set " without an argument.
226+ When the option was set by hand there is no "Last set" message.
227+ When the option was set while executing a function , user command or
228+ END
229+ call writefile (textlines, ' Xtextfile' )
230+
231+ let script = << trim END
232+ set cursorline scrolloff = 2
233+ normal 12 G
234+ END
235+ call writefile (script , ' Xscript' )
236+
237+ let buf = RunVimInTerminal (' -S Xscript Xtextfile' , #{rows: 20 , cols: 40 })
238+ call VerifyScreenDump (buf , ' Test_cursorline_redraw_1' , {})
239+ call term_sendkeys (buf , " zt" )
240+ call TermWait (buf )
241+ call term_sendkeys (buf , " \<C-U> " )
242+ call VerifyScreenDump (buf , ' Test_cursorline_redraw_2' , {})
243+
244+ call StopVimInTerminal (buf )
245+ call delete (' Xscript' )
246+ call delete (' Xtextfile' )
247+ endfunc
248+
200249" vim: shiftwidth = 2 sts = 2 expandtab
0 commit comments