diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-02-14 05:34:30 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-14 05:34:30 -0500 |
| commit | 0864939cc58d3f0af1a88a4baf34ed6b2a2c53ed (patch) | |
| tree | 49c06fff9c5adf6bc1d93e49de59b697d53f4b11 /test/functional/vimscript/executable_spec.lua | |
| parent | b5ce7e74dcde885afeee7f0d943a196a5ec450f2 (diff) | |
| download | rneovim-0864939cc58d3f0af1a88a4baf34ed6b2a2c53ed.tar.gz rneovim-0864939cc58d3f0af1a88a4baf34ed6b2a2c53ed.tar.bz2 rneovim-0864939cc58d3f0af1a88a4baf34ed6b2a2c53ed.zip | |
fix(restart): append `-c <cmd>` at end, drop `-- [files…]` #37846
Problem:
- `:restart <cmd>` prepends `-c <cmd>` before the original `-c` args (if
any). So the original `-c` args may "override" it, which is
surprising.
- Confusing logic: `v:argv` is partially prepared in `ex_docmd.c`, and
then later `ui.c` skips other parts of it.
Current behavior is nonsense, for example this sequence:
:restart echo "Hello"
:restart +qall echo "Hello" | echo "World"
results in this v:argv:
[
'nvim'
'-c'
'echo "Hello" | echo "World"'
'--embed'
'-c'
'echo "Hello"'
...
]
Whereas after this commit, v:argv is:
[
'nvim'
'--embed'
...
'-c'
'echo "Hello" | echo "World"'
]
Solution:
- Append `-c <cmd>` at the _end_ of `v:argv`, not the start.
- Use a dummy placeholder `+:::` to mark where the "restart command"
appears in `v:argv`.
- Do all `v:argv` preparation in `ex_docmd.c`. This simplifies `ui.c`.
- Drop `-- [files…]` from `v:argv` since it is probably more annoying
than useful. (Users can use sessions to restore files on restart.)
Diffstat (limited to 'test/functional/vimscript/executable_spec.lua')
0 files changed, 0 insertions, 0 deletions