Jiří Techet wrote:

> This is a pretty frequent work pattern of mine:
> 
> 1. Editing file A
> 2. Searching for function and opening file B
> 3. Closing file B because I just wanted to look at the function definition
> 4. Without this patch I get to the file following the B's tab (which
> is just a random file) but my brain expects that I get to A
> 
> I know it's possible to kind of simulate the behaviour I want with
> the "next to current" placement option but I really don't see a single
> advantage of having tabs closed in sequential order. This is also
> why I didn't make this behaviour optional. But maybe I miss some
> use case of tabs being closed sequentially - just tell me.

I like this patch. It seems logical to me.

I have another thing to add on top of this.

When closing the last tab, I feel is a bit weird to have a huge
window in the colour of the Gtk menu background. The attached
patch detects the closing of the last tab and immediately creates
a new Untitled tab.

I haven't tested it, but I'm pretty sure my patch depends on
Jiří's patch:

    0008-When-closing-tab-return-to-the-document-at-the-top-o.patch

Cheers,
Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/
=== modified file 'src/keybindings.c'
Index: geany-bzr/src/keybindings.c
===================================================================
--- geany-bzr.orig/src/keybindings.c
+++ geany-bzr/src/keybindings.c
@@ -589,6 +589,9 @@
 	if (current && g_queue_peek_head(mru_docs) == current)
 		g_queue_pop_head(mru_docs);
 
+	if (! document_get_current())
+		document_new_file(NULL, NULL, NULL);
+
 	return FALSE;
 }
 
_______________________________________________
Geany-devel mailing list
Geany-devel@uvena.de
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel

Reply via email to