Re: E331: Must not add menu items directly to menu bar
- Benji Fisher wrote:
> This could be interpreted as requiring a path before the menu item, but IWell, I thought it was obvious. And when someone didn't get it, he will get
> think (especially since :help E331 leads to this section in the Vim 6.0 help
> files) it should be more explicit. How about adding "(nonempty) " before
an error message.
> I tried using an empty path:I'm sure there is a menu without-a-name now! You can use it by moving the
> :menu .Foo :echo "foo"<CR>
> This generated neither an error, a warning, nor a menu item. Shouldn't it
> do at least one? ;)
mouse pointer to the character between "". :-)
I'll make this an error.
Actually ":emenu .Foo" works.
hundred-and-one symptoms of being an internet addict:
96. On Super Bowl Sunday, you followed the score by going to the
Yahoo main page instead of turning on the TV.
/// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
\\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
- Bram Moolenaar wrote:
> Benji Fisher wrote:
> > I tried using an empty path:So it does. Also, when I looked closer, I realized that there was extra
> > :menu .Foo :echo "foo"<CR>
> > This generated neither an error, a warning, nor a menu item. Shouldn't it
> > do at least one? ;)
> I'm sure there is a menu without-a-name now! You can use it by moving the
> mouse pointer to the character between "". :-)
> I'll make this an error.
> Actually ":emenu .Foo" works.
space before the "Help" menu. Clicking there, I get two options: "Tear off
this menu," which generates an error, and "Foo", which works as expected.
That's in Vim 5.7: in 6.0aj, the first opens up the Toolbar menu.
Well, I guess it does not matter much if this is going to be an error in
the next version.
- Le Mercredi 4 juillet 2001, à 01:36, Bram Moolenaar a écrit :
>Also on some OS like MacOS there's no easy way of getting an empty menu
> Benji Fisher wrote:
>> Bohdan Vlasyuk wrote:
>>> Why does it hapepn ? What can't I add new menu directly to menu bar??
>> Do you mean like
>> :menu Foo :echo "foo"<CR>
>> That is pretty unusual, but I suppose you have your reasons. It seems
>> that a
>> menu item needs to be inside a menu, so
>> :menu Foo.f :echo "foo"<CR>
>> works. Sorry, I do not know why. If this restriction is needed, I
>> think the
>> docs should be more explicit about it.
> I thought it's pretty obvious. If you would add an item directly to
> the menu
> bar it would be a button, not a menu. This is bad UI design (ever used
> The shell item in the top bar brings down a menu with choices, the
> item immediately does a shutdown. Very confusing!).
to act like a button. But an empty menu doesn't hurt anything generally.
Vim should probably accept:
" Above there's nothing after the FIle
:menu File.Edit :e<CR>
As it's logical to create the menu first, then add the item to it.
The help (or error message) could mention something like:
"Only menu item can have action associated to them."
- On Wed, Jul 04, 2001 at 08:59:53PM +0200, Bram Moolenaar wrote:
>> This could be interpreted as requiring a path before the menu item,Personally for me natural way seem to be "create empty menu first, and
>> but I think (especially since :help E331 leads to this section in
>> the Vim 6.0 help files) it should be more explicit. How about
>> adding "(nonempty) " before "path"?
> Well, I thought it was obvious. And when someone didn't get it, he
> will get an error message.
then add subentries"
A Riverside, California, health ordinance states that two persons may
not kiss each other without first wiping their lips with carbolized rosewater.