[PATCH] Add new "Open new Tab"-Tab to the tab bar
TK Soh
teekaysoh at gmail.com
Tue Oct 27 10:10:57 CET 2009
On Tue, Oct 27, 2009 at 7:16 AM, Bert Wesarg <bert.wesarg at googlemail.com> wrote:
> On Tue, Oct 27, 2009 at 02:22, TK Soh <teekaysoh at gmail.com> wrote:
>> On Tue, Oct 27, 2009 at 12:50 AM, TK Soh <teekaysoh at gmail.com> wrote:
>>> I tried your patch to both tip and BETA-5-6 branch, but failed to make:
>>>
>>> window.c: In function 'raiseTabCB':
>>> window.c:4721: error: too many arguments to function 'EditNewFile'
>>>
>>> What did I misss?
>>
>> FYI, I took out the last argv, and it seem to work now:
>>
>> [r28629 at protogen: ~/NEdit/wesarg]% hg diff
>> diff --git a/source/window.c b/source/window.c
>> --- a/source/window.c
>> +++ b/source/window.c
>> @@ -4718,7 +4718,7 @@
>> WindowInfo *window = lastFocusDocument;
>> if (!window)
>> window = TabToWindow(tabList[cbs->pos - 2]);
>> - EditNewFile(window, NULL, False, NULL, window->path, False);
>> + EditNewFile(window, NULL, False, NULL, window->path);
>> CheckCloseDim();
>> cbs->allowActivate = 0;
>> }
> That should be correct, thanks.
>
>>
>> The '+' tab has the same width as the others, but I understand this is
>> just a first draft. Nice work otherwise :-)
> Now comes the motif experts into play, someone around? I will look
> today into it, how I can beautify this tab.
Thanks.
BTW, I ran into a coredump when opening new tab. To recreate, disable
'Hide Tab Bar...', then click on the '+' tab. Here's my quick fix on
top of my earlier one:
diff --git a/source/window.c b/source/window.c
--- a/source/window.c
+++ b/source/window.c
@@ -4715,9 +4715,7 @@
tab = tabList[cbs->pos];
RaiseDocument(TabToWindow(tab));
} else {
- WindowInfo *window = lastFocusDocument;
- if (!window)
- window = TabToWindow(tabList[cbs->pos - 2]);
+ WindowInfo *window = GetTopDocument(w);
EditNewFile(window, NULL, False, NULL, window->path);
CheckCloseDim();
cbs->allowActivate = 0;
The patch also open the new tab using the path of the top/active
document, which I feel it's more consistent with original nedit
behavior on opening new tab.
It's been some time since I last looked at nedit source code, so I'm
not sure if I might miss out something here.
More information about the Discuss
mailing list