mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 02:46:31 +00:00
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)
a42df5934b
This commit is contained in:
@@ -518,6 +518,43 @@ func Test_winrestcmd()
|
|||||||
only
|
only
|
||||||
endfunc
|
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()
|
func Test_relative_cursor_position_in_one_line_window()
|
||||||
new
|
new
|
||||||
only
|
only
|
||||||
|
Reference in New Issue
Block a user