Merge pull request #16667 from neovim/backport-16420-to-release-0.6

[Backport release-0.6] vim-patch:8.1.2136,8.2.2465
This commit is contained in:
Björn Linse 2021-12-26 18:36:04 +01:00 committed by GitHub
commit 1cc63abf4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 2 deletions

View File

@ -5248,6 +5248,9 @@ search_line:
if (depth == -1) {
// match in current file
if (l_g_do_tagpreview != 0) {
if (!win_valid(curwin_save)) {
break;
}
if (!GETFILE_SUCCESS(getfile(curwin_save->w_buffer->b_fnum, NULL,
NULL, true, lnum, false))) {
break; // failed to jump to file

View File

@ -33,7 +33,7 @@ if has('timers')
let g:triggered = 0
au CursorHoldI * let g:triggered += 1
set updatetime=20
call timer_start(LoadAdjust(100), 'ExitInsertMode')
call timer_start(LoadAdjust(200), 'ExitInsertMode')
call feedkeys('a', 'x!')
call assert_equal(1, g:triggered)
unlet g:triggered
@ -1897,6 +1897,26 @@ func Test_autocmd_CmdWinEnter()
call delete(filename)
endfunc
func Test_autocmd_was_using_freed_memory()
pedit xx
n x
augroup winenter
au WinEnter * if winnr('$') > 2 | quit | endif
augroup END
" Nvim needs large 'winwidth' and 'nowinfixwidth' to crash
set winwidth=99999 nowinfixwidth
split
augroup winenter
au! WinEnter
augroup END
set winwidth& winfixwidth&
bwipe xx
bwipe x
pclose
endfunc
func Test_FileChangedShell_reload()
if !has('unix')
return
@ -2125,6 +2145,19 @@ func Test_autocmd_closes_window()
au! BufWinLeave
endfunc
func Test_autocmd_quit_psearch()
sn aa bb
augroup aucmd_win_test
au!
au BufEnter,BufLeave,BufNew,WinEnter,WinLeave,WinNew * if winnr('$') > 1 | q | endif
augroup END
ps /
augroup aucmd_win_test
au!
augroup END
endfunc
func Test_autocmd_closing_cmdwin()
au BufWinLeave * nested q
call assert_fails("norm 7q?\n", 'E855:')

View File

@ -4525,6 +4525,7 @@ static void win_enter_ext(win_T *const wp, const int flags)
fix_current_dir();
// Careful: autocommands may close the window and make "wp" invalid
if (flags & WEE_TRIGGER_NEW_AUTOCMDS) {
apply_autocmds(EVENT_WINNEW, NULL, NULL, false, curbuf);
}
@ -4558,7 +4559,7 @@ static void win_enter_ext(win_T *const wp, const int flags)
}
// set window width to desired minimal value
if (curwin->w_width < p_wiw && !curwin->w_p_wfw && !wp->w_floating) {
if (curwin->w_width < p_wiw && !curwin->w_p_wfw && !curwin->w_floating) {
win_setwidth((int)p_wiw);
}