[Geany-devel] [Patch] : On closing the last tab create new untitled document.

Nick Treleaven nick.treleaven at xxxxx
Thu Sep 23 16:37:56 UTC 2010


On Wed, 22 Sep 2010 14:43:15 +0300
Liviu Andronic <landronimirc at gmail.com> wrote:

> On Wed, Sep 22, 2010 at 2:17 PM, Jiří Techet <techet at gmail.com> wrote:
> > And just to keep the number of people who like/dislike this feature
> > balanced, I must say I rather dislike it :-). I find it strange when I
> > press the 'x' button on the tab and the tab reopens again. I had a
> > look at other editors and it works this way:

I think it wouldn't be so bad if the redraw wasn't so obvious, but that
was the safest & easiest way to implement it.

> > * editors which have "x" button in the tab to close it do not
> > automatically open empty document (gedit, codeblocks)
> > * editors which don't use tabs or don't have close button in the tab
> > open empty document
> >
> > In my opinion the only correct way to implement the automatic empty
> > document opening is also to hide tab bar completely when only a single
> > document is open (SciTE does it this way).
> >
> Personally I tend to prefer having the tabbar displayed at all times,
> in most tabbed apps.
> 
> 
> > Actually this would be also
> > nice to save some extra space in the editor for the editing area if
> > people are editing just a single document.

We could have a (hidden?) pref for auto-hiding the tabbar.

> Alternatively the "x"
> > button should disappear if a single tab is displayed (firefox works
> > this way).
> >
> ..if a single _untitled_ tab is displayed. This is the way Opera
> handles it, and that the behaviour that I find ergonomic in this case;
> it allows to close the last titled document tab without the need to
> close the app. As soon as the document gets modified or gets a title,
> the 'x' should be restored. Midori, Xfce's web browser with 'always
> show tabbar' enabled, behaves similarly to Opera, although it keeps a
> non-functional 'x' even on the last empty tab; clicking on the last
> empty tab doesn't close it/re-open another empty, so I guess the
> unnecessary 'x' can be reported as a bug.

The trouble is, it's difficult to tell if the document is 'modified',
as that can include changing indent settings, encoding, etc, not
necessarily a textual change.

> I'm not sure that this is all worth the effort, but I'd surely love if
> Geany handled last, empty tabs this way. Regards
> Liviu
> 
> 
> > That said, this is actually not a feature I care much about so can
> > stay the way it is if the majority of people prefer the current
> > behaviour.

I've now made a hidden pref* for this behaviour, off by default. It
could be made into a GUI pref though.

* new_document_after_close=true under [geany] in geany.conf.

Regards,
Nick



More information about the Devel mailing list