[vim/vim] Buffer modified within autocommand considered as non-changed (Issue #21427)

9 views
Skip to first unread message

Maxim Kim

unread,
Oct 2, 2026, 2:42:22 AM (4 days ago) Oct 2
to vim/vim, Subscribed
habamax created an issue (vim/vim#21427)

Steps to reproduce

  1. vim --clean
  2. :autocmd BufNewFile * call append(0, "test")
  3. :e test
  4. :q

Expected behaviour

E37: No write since last change error should prevent vim exit.

Instead vim exits, loosing changes added by autocmd.

:echo getbufinfo(bufnr()) shows changed: 0

source: https://groups.google.com/g/vim_use/c/FwZD4NkKNSw

Version of Vim

9.2.1162

Environment

debian13, bash

Logs and stack traces

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/21427@github.com>

Maxim Kim

unread,
Oct 2, 2026, 2:52:34 AM (4 days ago) Oct 2
to vim/vim, Subscribed
habamax left a comment (vim/vim#21427)

:h 'modified'

	This option is not set when a change is made to the buffer as the
	result of a BufNewFile, BufRead/BufReadPost, BufWritePost,
	FileAppendPost or VimLeave autocommand event.  See |gzip-example| for
	an explanation.
	When 'buftype' is "nowrite" or "nofile" this option may be set, but
	will be ignored.

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/21427/5946964837@github.com>

Maxim Kim

unread,
Oct 2, 2026, 2:53:23 AM (4 days ago) Oct 2
to vim/vim, Subscribed
habamax left a comment (vim/vim#21427)

Although, the original issue was about Filetype event, probably help should be updated.

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/21427/5946973689@github.com>

Reply all
Reply to author
Forward
0 new messages