mirror of
https://github.com/neovim/neovim.git
synced 2025-10-15 14:26:07 +00:00
vim-patch:9.0.0756 #20680
Problem: No autocmd event for changing text in a terminal window.
Solution: Add TextChangedT. (Shougo Matsushita, closes vim/vim#11366)
4ccaedfcd7
This commit is contained in:
@@ -108,6 +108,7 @@ return {
|
||||
'TextChanged', -- text was modified
|
||||
'TextChangedI', -- text was modified in Insert mode(no popup)
|
||||
'TextChangedP', -- text was modified in Insert mode(popup)
|
||||
'TextChangedT', -- text was modified in Terminal mode
|
||||
'TextYankPost', -- after a yank or delete was done (y, d, c)
|
||||
'UIEnter', -- after UI attaches
|
||||
'UILeave', -- after UI detaches
|
||||
|
@@ -523,6 +523,18 @@ static int terminal_check(VimState *state)
|
||||
|
||||
if (must_redraw) {
|
||||
update_screen();
|
||||
|
||||
// Make sure an invoked autocmd doesn't delete the buffer (and the
|
||||
// terminal) under our fingers.
|
||||
curbuf->b_locked++;
|
||||
|
||||
// save and restore curwin and curbuf, in case the autocmd changes them
|
||||
aco_save_T aco;
|
||||
aucmd_prepbuf(&aco, curbuf);
|
||||
apply_autocmds(EVENT_TEXTCHANGEDT, NULL, NULL, false, curbuf);
|
||||
aucmd_restbuf(&aco);
|
||||
|
||||
curbuf->b_locked--;
|
||||
}
|
||||
|
||||
if (need_maketitle) { // Update title in terminal-mode. #7248
|
||||
|
Reference in New Issue
Block a user