[vim/vim] Correctly check for editing a last file in the argument list. Add a test (#5596)

18 views
Skip to first unread message

Yegappan Lakshmanan

unread,
Feb 7, 2020, 11:53:13 PM2/7/20
to vim/vim, Subscribed

When quitting Vim using the :quit command, if there are still files in the argument
list to edit, then the E173: error message is displayed. The following commands
will produce this error:

args a b c
quit

This error is not displayed if the argument list is set using only a single file and
then files are added to the argument list using argadd:

args a
argadd b c
quit

The attached patch fixes this issue. The error message is now displayed if
the argument list has still files to edit.


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

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

Commit Summary

  • Correctly check for editing a last file in the argument list. Add a test

File Changes

Patch Links:


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

Bram Moolenaar

unread,
Feb 8, 2020, 10:00:43 AM2/8/20
to vim/vim, Subscribed

I'm not sure we want to change this. The error can be quite annoying and in general it's just a warning that you forgot to edit some files. Usually it's easy to get back that argument list, it's not like unsaved data will be lost. I suspect more users will get annoyed by the error than anything else.

Yegappan Lakshmanan

unread,
Feb 8, 2020, 10:54:57 AM2/8/20
to vim_dev, reply+ACY5DGH7G22EI3CBF2...@reply.github.com, vim/vim, Subscribed
Hi Bram,

> On Sat, Feb 8, 2020 at 7:00 AM Bram Moolenaar <vim-dev...@256bit.org> wrote:
>
> I'm not sure we want to change this. The error can be quite annoying
> and in general it's just a warning that you forgot to edit some files.
> Usually it's easy to get back that argument list, it's not like
> unsaved data will be lost. I suspect more users will get annoyed by
> the error than anything else.
>

This change doesn't introduces any new places/conditions where
this warning message is displayed. It only fixes it so that the message
is displayed when files are added later to a single argument list and
the user has not yet edited the last file in the list. The user will see
the same behavior if he directly sets the argument list with multiple files.

Regards,
Yegappan

vim-dev ML

unread,
Feb 8, 2020, 10:55:19 AM2/8/20
to vim/vim, vim-dev ML, Your activity

Yegappan Lakshmanan

unread,
Feb 8, 2020, 11:46:50 AM2/8/20
to vim/vim, vim-dev ML, Push

@yegappan pushed 1 commit.


You are receiving this because you are subscribed to this thread.

View it on GitHub or unsubscribe.

Codecov

unread,
Feb 8, 2020, 12:14:09 PM2/8/20
to vim/vim, vim-dev ML, Comment

Codecov Report

Merging #5596 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@

##           master    #5596      +/-   ##

==========================================

+ Coverage   83.15%   83.16%   +<.01%     

==========================================

  Files         137      137              

  Lines      152059   152065       +6     

==========================================

+ Hits       126452   126471      +19     

+ Misses      25607    25594      -13
Impacted Files Coverage Δ
src/arglist.c 92.97% <100%> (+0.01%) ⬆️
src/gui.c 63.43% <0%> (-0.11%) ⬇️
src/channel.c 84% <0%> (-0.08%) ⬇️
src/message_test.c 100% <0%> (ø) ⬆️
src/version.c 92.1% <0%> (ø) ⬆️
src/window.c 88.59% <0%> (+0.03%) ⬆️
src/os_unix.c 63.68% <0%> (+0.04%) ⬆️
src/ui.c 72.4% <0%> (+0.08%) ⬆️
src/evalfunc.c 91.79% <0%> (+0.1%) ⬆️
src/if_xcmdsrv.c 86.35% <0%> (+0.17%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6702188...c93a42b. Read the comment docs.


You are receiving this because you commented.

Bram Moolenaar

unread,
Feb 8, 2020, 1:39:50 PM2/8/20
to vim...@googlegroups.com, Yegappan Lakshmanan, reply+ACY5DGH7G22EI3CBF2...@reply.github.com
Well, it does add another situation where the error shows. It may be
logical to do this, but I suspect users are rather annoyed than pleased
with this error.

--
I started out with nothing, and I still have most of it.
-- Michael Davis -- "Tonight Show"

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

vim-dev ML

unread,
Feb 8, 2020, 1:39:54 PM2/8/20
to vim/vim, vim-dev ML, Your activity

Yegappan Lakshmanan

unread,
Feb 9, 2020, 10:46:54 AM2/9/20
to vim/vim, vim-dev ML, Comment

Closed #5596.


You are receiving this because you commented.

Reply all
Reply to author
Forward
0 new messages