[vim/vim] a dry run can run a shell command or write a file (PR #21425)

7 views
Skip to first unread message

h_east

unread,
Oct 1, 2026, 2:29:32 PM (2 days ago) Oct 1
to vim/vim, Subscribed
Problem:  With ":source ++dryrun" a builtin function in the value of a
          legacy ":const" or in a function name with braces is called,
          and only the skipping of commands keeps a line that is taken
          for a command from running a shell command or writing a file.
Solution: Do not execute a legacy ":const" in a dry run.  Give an error
          for any function call (E1588), and for a shell command, a
          written file and the other things check_secure() refuses, and
          for a command that does not define something right before it
          would be executed (E1589).

Test_source_dryrun_no_side_effect checks that the value of a legacy
":const" calling writefile() creates no file, that a function name with
braces calling writefile() gives E1584 and creates no file, and that the
lines after an "endfunction" inside an unrecognized "py3<<EOF" heredoc
with ":w!" and system() create no file.

related: #21257


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

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

Commit Summary

  • 580ee2b a dry run can run a shell command or write a file

File Changes

(9 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/21425@github.com>

Reply all
Reply to author
Forward
0 new messages