Problem: BufWinEnter does not work well for a terminal window.
Solution: Do not trigger BufWinEnter when opening a terminal window.
existing buffer. But it does happen for a
":split" with the name of the current buffer,
since it reloads that buffer.
+ Does not happen for a terminal window, because
+ it starts in Terminal-Job mode and Normal mode
+ commands won't work. Use |TerminalOpen| instead.
*BufWinLeave*
BufWinLeave Before a buffer is removed from a window.
Not when it's still visible in another window.
* a deadlock if the job is waiting for Vim to read. */
channel_set_nonblock(term->tl_job->jv_channel, PART_IN);
- if (old_curbuf == NULL)
- {
- ++curbuf->b_locked;
- apply_autocmds(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf);
- --curbuf->b_locked;
- }
- else
+ if (old_curbuf != NULL)
{
--curbuf->b_nwindows;
curbuf = old_curbuf;
endfunc
func Test_terminal_basic()
- au BufWinEnter * if &buftype == 'terminal' | let b:done = 'yes' | endif
+ au TerminalOpen * let b:done = 'yes'
let buf = Run_shell_in_terminal({})
if has("unix")
close
call assert_equal("", bufname(buf))
- au! BufWinEnter
+ au! TerminalOpen
unlet g:job
endfunc
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1789,
/**/
1788,
/**/