2016-09-15 16:45 GMT+09:00 Kazunobu Kuriyama <kazunobu.kuriy...@gmail.com>:

> 2016-09-15 7:41 GMT+09:00 Tony Mechelynck <antoine.mechely...@gmail.com>:
>
>> exists() result is sometimes misleading for a command.
>>
>> Example (with GTK3 gvim linked with GTK 3.16.7):
>>     :echo exists(':tearoff')
>>         2
>>     :tearoff &Help
>>         E319: Sorry, the command is not available in this version
>>
>> So for example the following code in my vimrc would produce the exact
>> error which it is meant to avoid:
>>
>>     au GUIEnter * if exists(':tearoff') == 2 | exe 'tearoff &Help' | endif
>>
>> If the :tearoff command is disabled in GTK3 gvim, then IMHO
>> exists(':tearoff') ought to return 0, not 2.
>>
>
> I looked into that a bit and found that it was not specific to GTK3.
>
> The same thing happens with the latest GTK2 GUI and that of 7.4.1401, the
> one just prior to the GTK3 patch inclusion.
>
> I tried to do a bisect search to find which patch introduced that
> regression, but failed due to a header file relocation on OS X as of 10.9,
> Mavericks.  I was unable to build vim older than 7.4.62.  Nonetheless, I
> confirm that the same regression was also seen with that version.
>
> Looks it has been there unnoticed for a long time.
>
> As for GTK3, if the GUI is linked against GTK+ 3.4 or later, tear-off
> menus are disabled, as written in 'h: tear-off-menus'.
>
> So, fixing the issue is quite easy for GTK >= 3.4; it can be fixed using a
> version check.  But I'm not sure what I can do for the rest for now.
>

For the purpose of fixing the issue, I began woking with git to know when
and how `:tearoff` was disabled for the GTK GUI.

After having skimmed relevant part of the codebase, I did `git blame
ex_docmds.c` and got:

071d4279d (Bram Moolenaar 2004-06-13 20:20:40 +0000   225) #if
defined(FEAT_GUI_W32) &&
defined(FEAT_MENU) && defined(FEAT_TEAROFF)
f28dbcea3 (Bram Moolenaar 2016-01-29 22:03:47 +0100   226) static void
 ex_tearoff(exarg_T *eap);
071d4279d (Bram Moolenaar 2004-06-13 20:20:40 +0000   227) #else
071d4279d (Bram Moolenaar 2004-06-13 20:20:40 +0000   228) # define
ex_tearoff          ex_ni
071d4279d (Bram Moolenaar 2004-06-13 20:20:40 +0000   229) #endif

Hmm, looks none of us has seen the command working correctly on a newly
built gvim for the last twelve years...

WTF!!  The same surely applies to the Motif GUI, too! (lol)

I'm now feeling as if my all strength were gone, indeed (笑)

Seriously, what should we do with the issue?   Should we restore the
command for the first time in twelve years?  Personally, abolishing it even
for GTK < 3.4 once for all appears to be now a reasonable, wise choice.

Best,
Kazunobu


>
> Best regards,
> Kazunobu
>
>
>>
>>
>> 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 vim_dev+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui