comparison src/testdir/test_modeline.vim @ 20269:246101db63a4 v8.2.0690

patch 8.2.0690: line number of option set by modeline is wrong Commit: https://github.com/vim/vim/commit/5125874951669944a5f6a4163d6e5d437ae6321e Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 3 17:19:33 2020 +0200 patch 8.2.0690: line number of option set by modeline is wrong Problem: Line number of option set by modeline is wrong. Solution: Do not double the line number. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/6035)
author Bram Moolenaar <Bram@vim.org>
date Sun, 03 May 2020 17:30:03 +0200
parents 61fa1a9d09dd
children 08940efa6b4e
comparison
equal deleted inserted replaced
20268:1a61225dc1d8 20269:246101db63a4
277 call s:modeline_fails('rulerformat', 'rulerformat=Something()', 'E992:') 277 call s:modeline_fails('rulerformat', 'rulerformat=Something()', 'E992:')
278 call s:modeline_fails('statusline', 'statusline=Something()', 'E992:') 278 call s:modeline_fails('statusline', 'statusline=Something()', 'E992:')
279 call s:modeline_fails('tabline', 'tabline=Something()', 'E992:') 279 call s:modeline_fails('tabline', 'tabline=Something()', 'E992:')
280 call s:modeline_fails('titlestring', 'titlestring=Something()', 'E992:') 280 call s:modeline_fails('titlestring', 'titlestring=Something()', 'E992:')
281 endfunc 281 endfunc
282
283 func Test_modeline_setoption_verbose()
284 let modeline = &modeline
285 set modeline
286
287 let lines =<< trim END
288 1 vim:ts=2
289 2 two
290 3 three
291 4 four
292 5 five
293 6 six
294 7 seven
295 8 eight
296 END
297 call writefile(lines, 'Xmodeline')
298 edit Xmodeline
299 let info = split(execute('verbose set tabstop?'), "\n")
300 call assert_match('^\s*Last set from modeline line 1$', info[-1])
301 bwipe!
302
303 let lines =<< trim END
304 1 one
305 2 two
306 3 three
307 4 vim:ts=4
308 5 five
309 6 six
310 7 seven
311 8 eight
312 END
313 call writefile(lines, 'Xmodeline')
314 edit Xmodeline
315 let info = split(execute('verbose set tabstop?'), "\n")
316 call assert_match('^\s*Last set from modeline line 4$', info[-1])
317 bwipe!
318
319 let lines =<< trim END
320 1 one
321 2 two
322 3 three
323 4 four
324 5 five
325 6 six
326 7 seven
327 8 vim:ts=8
328 END
329 call writefile(lines, 'Xmodeline')
330 edit Xmodeline
331 let info = split(execute('verbose set tabstop?'), "\n")
332 call assert_match('^\s*Last set from modeline line 8$', info[-1])
333 bwipe!
334
335 let &modeline = modeline
336 call delete('Xmodeline')
337 endfunc