Mercurial > vim
diff 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 |
line wrap: on
line diff
--- a/src/testdir/test_modeline.vim +++ b/src/testdir/test_modeline.vim @@ -279,3 +279,59 @@ func Test_modeline_fails_modelineexpr() call s:modeline_fails('tabline', 'tabline=Something()', 'E992:') call s:modeline_fails('titlestring', 'titlestring=Something()', 'E992:') endfunc + +func Test_modeline_setoption_verbose() + let modeline = &modeline + set modeline + + let lines =<< trim END + 1 vim:ts=2 + 2 two + 3 three + 4 four + 5 five + 6 six + 7 seven + 8 eight + END + call writefile(lines, 'Xmodeline') + edit Xmodeline + let info = split(execute('verbose set tabstop?'), "\n") + call assert_match('^\s*Last set from modeline line 1$', info[-1]) + bwipe! + + let lines =<< trim END + 1 one + 2 two + 3 three + 4 vim:ts=4 + 5 five + 6 six + 7 seven + 8 eight + END + call writefile(lines, 'Xmodeline') + edit Xmodeline + let info = split(execute('verbose set tabstop?'), "\n") + call assert_match('^\s*Last set from modeline line 4$', info[-1]) + bwipe! + + let lines =<< trim END + 1 one + 2 two + 3 three + 4 four + 5 five + 6 six + 7 seven + 8 vim:ts=8 + END + call writefile(lines, 'Xmodeline') + edit Xmodeline + let info = split(execute('verbose set tabstop?'), "\n") + call assert_match('^\s*Last set from modeline line 8$', info[-1]) + bwipe! + + let &modeline = modeline + call delete('Xmodeline') +endfunc