[vim/vim] a command block in a block that is not executed is read as commands (PR #21349)

16 views
Skip to first unread message

h_east

unread,
Sep 19, 2026, 8:05:39 PMSep 19
to vim/vim, Subscribed
Problem:  Inside a block that is not executed, "if 0" for one, the
          lines of a ":command" or ":autocmd" block are read as
          commands, since neither command is executed while skipping.
          A line like "Foo(<q-args>)" then ends the script with E1010.
          A ":source ++dryrun" hits this at the script level.
Solution: Execute the two commands while skipping, like ":function",
          and only read the block then.

related: #21331


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/21349

Commit Summary

  • 447e50c a command block in a block that is not executed is read as commands

File Changes

(4 files)

Patch Links:

—
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/pull/21349@github.com>

Christian Brabandt

unread,
Sep 25, 2026, 5:46:17 PM (12 days ago) Sep 25
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#21349)

thanks

—
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/pull/21349/c5840095837@github.com>

dkearns

unread,
Oct 1, 2026, 1:34:46 PM (7 days ago) Oct 1
to vim/vim, Subscribed
dkearns left a comment (vim/vim#21349)

I wish I were incredulous that you'd pushed for the resurrection and merging of this PR, unmodified.

Along with completely ignoring Vim9 handling, which has now been implemented at least twice, this PR also completely ignores Vim's unique autoindented end '.' marker behaviour in script files.

I'm planning on making a case for removing support for indented '.' from scripts. It seems clear to me that it was only implemented as an interactive convenience in Vi but it's harder to be certain of the intent with Vim. Without giving it much thought over the years, I'd always assumed it was supposed to function like "trim". I'm waiting on someone to get back to me regarding a related reading of the POSIX spec and since the 'feature' has been around for a long time in Vim I wanted to do a decent survey of its usage. I had planned to remove it before bothering with skipping as it's impossible to properly support.

This implementation also indulges the AI's fetish for pointless function extraction and early returns.

If skipping was considered fixed properly we should also have updated the help to reflect that.

@chrisbra cannot be expected review this flood of PRs in extreme detail and is relying on contributors to at least make a fair effort to get things right. Ten minutes of testing this by hand would turn up most of the problems. #21349 has more of the same and worse, from a quick skimming.

—
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/pull/21349/c5936921497@github.com>

Reply all
Reply to author
Forward
0 new messages