[patch] can not write a trail comment to the :hide command

56 views
Skip to first unread message

h_east

unread,
Nov 13, 2016, 12:33:27 PM11/13/16
to vim_dev
Hi Bram and list,

How to reproduce:
- Start vanilla Vim with two buffers.
$ vim -Nu NONE -o a b
- buffer 'a' to modified.
:set modofied
- exec :hide command with trail comment
:hide " command

Expected behavior:
- :hide command succeed.

Actual behavior:
- Occurred 'E474: Invalid argument'


I wrote a patch. Of course contains a test.
Check it please.
--
Best regards,
Hirohito Higashi (a.k.a. h_east)

fix_can_not_comment_after_hide_cmd.patch

Bram Moolenaar

unread,
Nov 14, 2016, 4:58:08 PM11/14/16
to vim...@googlegroups.com, h_east

Hirohito Higashi wrote:

> Hi Bram and list,
>
> How to reproduce:
> - Start vanilla Vim with two buffers.
> $ vim -Nu NONE -o a b
> - buffer 'a' to modified.
> :set modofied
> - exec :hide command with trail comment
> :hide " command
>
> Expected behavior:
> - :hide command succeed.
>
> Actual behavior:
> - Occurred 'E474: Invalid argument'
>
>
> I wrote a patch. Of course contains a test.
> Check it please.

Can you add a test that does something like this:

:hide echo "one|two"

To check that the bar is not recognized to separate commands?


--
How To Keep A Healthy Level Of Insanity:
4. Put your garbage can on your desk and label it "in".

/// 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 ///

h_east

unread,
Nov 15, 2016, 6:05:55 AM11/15/16
to vim_dev, h.eas...@gmail.com
Hi Bram and list,

2016-11-15(Tue) 6:58:08 UTC+9 Bram Moolenaar:


> Hirohito Higashi wrote:
>
> > Hi Bram and list,
> >
> > How to reproduce:
> > - Start vanilla Vim with two buffers.
> > $ vim -Nu NONE -o a b
> > - buffer 'a' to modified.
> > :set modofied
> > - exec :hide command with trail comment
> > :hide " command
> >
> > Expected behavior:
> > - :hide command succeed.
> >
> > Actual behavior:
> > - Occurred 'E474: Invalid argument'
> >
> >
> > I wrote a patch. Of course contains a test.
> > Check it please.
>
> Can you add a test that does something like this:
>
> :hide echo "one|two"
>
> To check that the bar is not recognized to separate commands?

Right, I added a test case.
Check an attached patch.

NOTE:
This issue was reported by Norio Takagi.

fix_can_not_comment_after_hide_cmd.patch

Bram Moolenaar

unread,
Nov 15, 2016, 3:17:41 PM11/15/16
to vim...@googlegroups.com, h_east
Thanks, I'll include it.

--
How To Keep A Healthy Level Of Insanity:
9. As often as possible, skip rather than walk.
Reply all
Reply to author
Forward
0 new messages