diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-07-13 21:49:13 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-07-15 23:07:29 -0400 |
commit | eace147bb0209ab0d238b79076b417d2f7d95275 (patch) | |
tree | cd652990ee11dcca6b9e0899a0f25a5f3658b5f9 | |
parent | e95945a1574327a025334c7ed285741ebdff4cd4 (diff) | |
download | rneovim-eace147bb0209ab0d238b79076b417d2f7d95275.tar.gz rneovim-eace147bb0209ab0d238b79076b417d2f7d95275.tar.bz2 rneovim-eace147bb0209ab0d238b79076b417d2f7d95275.zip |
vim-patch:8.1.0630: "wincmd p" does not work after using an autocmd window
Problem: "wincmd p" does not work after using an autocmd window.
Solution: Store "prevwin" in aco_save_T. (Christian Brabandt, closes vim/vim#3690)
https://github.com/vim/vim/commit/a42df5934bdc1178ed2ee8cb9c8686975b578497
-rw-r--r-- | src/nvim/testdir/test_window_cmd.vim | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_window_cmd.vim b/src/nvim/testdir/test_window_cmd.vim index 003a23ea7b..2a07a04401 100644 --- a/src/nvim/testdir/test_window_cmd.vim +++ b/src/nvim/testdir/test_window_cmd.vim @@ -518,6 +518,43 @@ func Test_winrestcmd() only endfunc +function! Fun_RenewFile() + sleep 2 + silent execute '!echo "1" > tmp.txt' + sp + wincmd p + edit! tmp.txt +endfunction + +func Test_window_prevwin() + " Can we make this work on MS-Windows? + if !has('unix') + return + endif + + set hidden autoread + call writefile(['2'], 'tmp.txt') + new tmp.txt + q + " Need to wait a bit for the timestamp to be older. + call Fun_RenewFile() + call assert_equal(2, winnr()) + wincmd p + call assert_equal(1, winnr()) + wincmd p + q + call Fun_RenewFile() + call assert_equal(2, winnr()) + wincmd p + call assert_equal(1, winnr()) + wincmd p + " reset + q + call delete('tmp.txt') + set hidden&vim autoread&vim + delfunc Fun_RenewFile +endfunc + func Test_relative_cursor_position_in_one_line_window() new only |