Hi Liu,

On 11/23/06, Liu Yubao <[EMAIL PROTECTED]> wrote:
Bram Moolenaar wrote:
> Yegappan Lakshmanan wrote:
>
>> On 11/22/06, Bram Moolenaar <[EMAIL PROTECTED]> wrote:
>>> It does happen for me:
>>>
>>>         "gvim somefile"
>>>         maximize gvim window
>>>         minimize gvim window
>>>         "gvim --remote-tab otherfile"
>>>
>>> Now I only see the tab label for "otherfile".  I can click on the gap
>>> before it to go to "somefile", and then only that label is shown.
>>>
>> Which version of MS-Windows (Win98/WinME/Win2K/WinXP/Vista)
>> are you using? I am not able to reproduce this problem using the
>> above steps on WinXP and Win2K.
>>
>> I am using the following version of Vim:
>>
>> VIM - Vi IMproved 7.0 (2006 May 7, compiled May  7 2006 16:21:39)
>> MS-Windows 32 bit GUI version
>> Compiled by [EMAIL PROTECTED]
>> Big version with GUI.  Features included (+) or not (-):
>>
>> Anybody else seeing this problem on MS-Windows?
>
> It apparently only happens when 'encoding' is set to "utf-8".  Can you
> reproduce it then?
>

I think I got it. In gui_w48.c:gui_mch_update_tabline(),
SendMessage(...TCM_INSERTITEMW...) is called at line 2408
but TabCtrl_SetItem(...) at line 2416. I'm a little confused
why it sends an INSERT message but not a SET one too.

Index: gui_w48.c
===================================================================
--- gui_w48.c   (revision 184)
+++ gui_w48.c   (working copy)
@@ -2405,7 +2405,7 @@
                tiw.mask = TCIF_TEXT;
                tiw.iImage = -1;
                tiw.pszText = wstr;
-               SendMessage(s_tabhwnd, TCM_INSERTITEMW, (WPARAM)nr,
+               SendMessage(s_tabhwnd, TCM_SETITEMW, (WPARAM)nr,
                                                                (LPARAM)&tiw);
                vim_free(wstr);
            }


This looks like the correct fix. The TCM_SETITEMW message should be
used instead of the TCM_INSERTITEMW message to modify the attributes
of an existing item in the tab control.

- Yegappan

Reply via email to