On Thu, Oct 11, 2018 at 5:25 PM Bram Moolenaar <[email protected]> wrote: > > > Christ van Willegen wrote: > > > On Wed, Oct 10, 2018 at 12:44 AM Tony Mechelynck > > <[email protected]> wrote: > > > Could it be because the g near the end of "vim-huge" is mistakenly > > > interpreted as meaning that I want to invoke gvim? > > > > I was in the source and accidentally bumped into the code that does > > this. Here is the comment above that function: > > > > /* > > * Check for: [r][e][g][vi|vim|view][diff][ex[im]] > > * If the executable name starts with "r" we disable shell commands. > > * If the next character is "e" we run in Easy mode. > > * If the next character is "g" we run the GUI version. > > * If the next characters are "view" we start in readonly mode. > > * If the next characters are "diff" or "vimdiff" we start in diff mode. > > * If the next characters are "ex" we start in Ex mode. If it's followed > > * by "im" use improved Ex mode. > > */ > > > > The code walks through the command name that invoked vim, and the [g] > > is indeed only checked at that point. So, the 'g' in huge does not > > automatically trigger a GUI, or at least, should not... > > > > Not sure where your problem comes from, but not from this part of the > > code... > > > > I see that the comment does not specify what it does with the [vi] and > > [vim] parts of the command name, but these are implied, I guess. > > > > Hey, weird... according to the spec above, I _should_ be able to start > > with 'viex' or 'viexim', but that is not caught at all! > > > > if (STRNICMP(initstr, "view", 4) == 0) > > { > > readonlymode = TRUE; > > curbuf->b_p_ro = TRUE; > > p_uc = 10000; /* don't update very often */ > > initstr += 4; > > } > > else if (STRNICMP(initstr, "vim", 3) == 0) > > initstr += 3; > > > > (I would expect to have a check for "vi" and an "initstr += 2;" as wel...) > > > > Bram, should the pattern at the top of this function be changed to > > note that these names for the executable are not recognized? Not sure > > if 'viex' or 'viexim' would make sense... > > It just lists the general pattern, not every exception. e.g. the 'e' > for "evim" or "egvim" doesn't always get recognized. > > I don't think there is an actual problem to fix here, right?
Well, IMHO when invoked with -? Vim ought never to start a GUI, it should display the help text then exit, and that's what the GTK2 version without Gnome does, even when invoked as "gvim -?"; OTOH the Gnome2 version invoked as "vim-huge -?" displays the help text, tries to start the GUI, fails, and then (if I hit Enter at the |hit-enter-prompt|), displays the intro screen and waits for console input. IMHO it should have exited after displaying the help text. Best regards, Tony. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
