}
}
win_found:
-
+#ifdef FEAT_JOB_CHANNEL
+ // May need to stop Insert mode if we were in a prompt buffer.
+ leaving_window(curwin);
+#endif
// Remove the window and frame from the tree of frames.
(void)winframe_remove(curwin, &dummy, NULL);
win_remove(curwin, NULL);
int make_windows(int count, int vertical);
void win_move_after(win_T *win1, win_T *win2);
void win_equal(win_T *next_curwin, int current, int dir);
+void leaving_window(win_T *win);
void entering_window(win_T *win);
void curwin_init(void);
void close_windows(buf_T *buf, int keep_curwin);
call StopVimInTerminal(buf)
endfunc
+func Test_prompt_appending_while_hidden()
+ call CanTestPromptBuffer()
+
+ let script =<< trim END
+ new prompt
+ set buftype=prompt
+ set bufhidden=hide
+
+ func s:TextEntered(text)
+ if a:text == 'exit'
+ close
+ endif
+ echowin 'Entered:' a:text
+ endfunc
+ call prompt_setcallback(bufnr(), function('s:TextEntered'))
+
+ func DoAppend()
+ call appendbufline('prompt', '$', 'Test')
+ endfunc
+ END
+ call writefile(script, 'XpromptBuffer', 'D')
+
+ let buf = RunVimInTerminal('-S XpromptBuffer', {'rows': 10})
+ call TermWait(buf)
+
+ call term_sendkeys(buf, "asomething\<CR>")
+ call TermWait(buf)
+
+ call term_sendkeys(buf, "exit\<CR>")
+ call TermWait(buf)
+
+ call term_sendkeys(buf, ":call DoAppend()\<CR>")
+ call TermWait(buf)
+ call assert_notmatch('-- INSERT --', term_getline(buf, 10))
+
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab