Mercurial > vim
diff src/testdir/test_window_cmd.vim @ 13666:57da3d873f20 v8.0.1705
patch 8.0.1705: when making a vertical split the mode message isn't updated
commit https://github.com/vim/vim/commit/5bab555c2f1b3b86d57e4adeb86d908eff477fc9
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Apr 13 20:41:29 2018 +0200
patch 8.0.1705: when making a vertical split the mode message isn't updated
Problem: When making a vertical split the mode message isn't always
updated, "VISUAL" remains. (Alexei Averchenko)
Solution: Only reset clear_cmdline when filling all columns of the last
screen line. (Tom M. closes #2611)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 13 Apr 2018 20:45:07 +0200 |
parents | 20fb8c711050 |
children | 60e80884994d |
line wrap: on
line diff
--- a/src/testdir/test_window_cmd.vim +++ b/src/testdir/test_window_cmd.vim @@ -483,4 +483,28 @@ func Test_access_freed_mem() bwipe xxx endfunc +func Test_visual_cleared_after_window_split() + new | only! + let smd_save = &showmode + set showmode + let ls_save = &laststatus + set laststatus=1 + call setline(1, ['a', 'b', 'c', 'd', '']) + norm! G + exe "norm! kkvk" + redraw + exe "norm! \<C-W>v" + redraw + " check if '-- VISUAL --' disappeared from command line + let columns = range(1, &columns) + let cmdlinechars = map(columns, 'nr2char(screenchar(&lines, v:val))') + let cmdline = join(cmdlinechars, '') + let cmdline_ltrim = substitute(cmdline, '^\s*', "", "") + let mode_shown = substitute(cmdline_ltrim, '\s*$', "", "") + call assert_equal('', mode_shown) + let &showmode = smd_save + let &laststatus = ls_save + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab