Benji Fisher wrote:
> > > $ vim
> > > :echo confirm("Save changes?", "&Yes\n&No\n&Cancel", 0)
> > > <user types <CR>>
> > > 0
> > > :gui
> > > :echo confirm("Save changes?", "&Yes\n&No\n&Cancel", 0)
> > > <user types <CR>>
> > > 1
> > >
> > > I did it that way to make sure that I was actually using the same binary
> > > with and without the GUI running. The second time I invoked confirm(),
> > > a dialogue box popped up with the "Yes" button highlighted.
> >
> > Many GUIs don't support a dialog without a button selected. Disabling
> > the use of Enter to select a button isn't a good idea either. Thus for
> > some GUIs it simply won't work to have a dialog without a default.
>
> I do not like the way it works now, since the GUI is not consistent
> with the terminal version. Would it be possible to add a "Cancel"
> button to the GUI dialogue box, and select this button if confirm() is
> called with argument 0 as above? I am not sure how terminal vim
> *should* respond to other out-of-range arguments (e.g., 4 instead of 0
> in the above example).
Adding a Cancel button completely goes against what the user specifies.
If you want a default to cancel you can specify it.
> I notice that the GUI confirm() returns 0 if I cancel the dialogue
> box with <Esc>. Ditto for terminal vim, but then I have to type <Esc>
> twice, which is odd. (Yes, I did wait more than 'timeoutlen' ms.)
I see this too.
--
Veni, Vidi, Video -- I came, I saw, I taped what I saw.
/// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///