[vim/vim] Active terminal causes :wall to fail with E676: No matching autocommands for acwrite buffer (#2190)

252 views
Skip to first unread message

Marius Gedminas

unread,
Oct 5, 2017, 9:18:46 AM10/5/17
to vim/vim, Subscribed

Steps to reproduce:

  1. vim -u NONE
  2. :term
  3. <C-W>:wall<CR>

What happens:

  • E676: No matching autocommands for acwrite buffer flashes briefly

What I expect

  • no confusing error message

Note that if the terminal is no longer active (e.g you exit the shell), :wall doesn't complain.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub

vim-dev ML

unread,
Oct 6, 2017, 5:15:01 AM10/6/17
to vim/vim, vim-dev ML, Your activity
On 13:18 Thu 05 Oct , Marius Gedminas wrote:
> Steps to reproduce:
>
> 1. `vim -u NONE`
> 2. `:term`
> 3. `<C-W>:wall<CR>`
>
> What happens:
>
> - `E676: No matching autocommands for acwrite buffer` flashes briefly
>
> What I expect
>
> - no confusing error message

>
> Note that if the terminal is no longer active (e.g you exit the shell), `:wall` doesn't complain.

I see this regularly, when using vim-fugitive :Gcommit command.

Regards,
Marcin

Gabriel Barta

unread,
Oct 10, 2017, 7:41:16 PM10/10/17
to vim/vim, vim-dev ML, Comment

This also happens to me all the time when I have a terminal open and try to use fzf for opening a buffer.

I think this should be fixed in vim itself although I am uncertain of the implementation details, but in the meantime I use the following workaround in my vimrc:

fun! s:workaroundIssue2190()
    " see https://github.com/vim/vim/issues/2190
    if &buftype=='terminal' && !exists('b:workaround_issue_2190')
        autocmd BufWriteCmd <buffer> echo 'workaround 2190'
        let b:workaround_issue_2190=1
    endif
endfun
aug workaroundIssue2190
    autocmd! BufWinEnter * call s:workaroundIssue2190()
aug END


You are receiving this because you commented.

mattn

unread,
Oct 11, 2017, 2:29:12 AM10/11/17
to vim/vim, vim-dev ML, Comment

Or add ignoring for write if buftype is nowrite or terminal.

diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index b4351b23d..79dc01314 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -3414,6 +3414,12 @@ do_wqall(exarg_T *eap)
 		++error;
 		break;
 	    }
+
+	    if (bt_dontwrite(buf))
+	    {
+		continue;
+	    }
+
 #ifdef FEAT_BROWSE
 	    /* ":browse wall": ask for file name if there isn't one */
 	    if (buf->b_ffname == NULL && cmdmod.browse)


You are receiving this because you commented.

Christian Brabandt

unread,
Oct 11, 2017, 4:39:48 PM10/11/17
to vim/vim, vim-dev ML, Comment

+1 for the patch ignoring not-writable buffers.


You are receiving this because you commented.

Bram Moolenaar

unread,
Oct 15, 2017, 4:43:00 PM10/15/17
to vim/vim, vim-dev ML, Comment

Closed #2190 via 059db5c.


You are receiving this because you commented.

Reply all
Reply to author
Forward
0 new messages