Revision: 3811 http://geany.svn.sourceforge.net/geany/?rev=3811&view=rev Author: ntrel Date: 2009-05-22 14:50:34 +0000 (Fri, 22 May 2009)
Log Message: ----------- Improve MRU document switching so there are no duplicates in the list and documents switched to whilst the dialog is open are ignored. Also beep when cycling through to the first document in the list.
Modified Paths: -------------- trunk/ChangeLog trunk/src/keybindings.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-05-21 19:19:12 UTC (rev 3810) +++ trunk/ChangeLog 2009-05-22 14:50:34 UTC (rev 3811) @@ -1,3 +1,12 @@ +2009-05-22 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> + + * src/keybindings.c: + Improve MRU document switching so there are no duplicates in the + list and documents switched to whilst the dialog is open are + ignored. Also beep when cycling through to the first document in the + list. + + 2009-05-21 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/dialogs.c:
Modified: trunk/src/keybindings.c =================================================================== --- trunk/src/keybindings.c 2009-05-21 19:19:12 UTC (rev 3810) +++ trunk/src/keybindings.c 2009-05-22 14:50:34 UTC (rev 3811) @@ -500,9 +500,11 @@ { GeanyDocument *old = document_get_current();
- /* when closing current doc, old is NULL */ - if (old) + /* when closing current doc, old is NULL. + * Don't add to the mru list when switch dialog is visible. */ + if (old && switch_dialog_cancelled) { + g_queue_remove(mru_docs, old); g_queue_push_head(mru_docs, old);
if (g_queue_get_length(mru_docs) > MAX_MRU_DOCS) @@ -517,8 +519,7 @@ GeanyDocument *current;
current = document_get_current(); - - while (current && g_queue_peek_head(mru_docs) == current) + if (current && g_queue_peek_head(mru_docs) == current) g_queue_pop_head(mru_docs);
return FALSE; @@ -529,7 +530,7 @@ { if (! main_status.quitting) { - g_queue_remove_all(mru_docs, doc); + g_queue_remove(mru_docs, doc); g_idle_add(on_idle_close, NULL); } } @@ -1558,7 +1559,10 @@ { return FALSE; } - mru_pos += 2; + if (! switch_dialog || !GTK_WIDGET_VISIBLE(switch_dialog)) + mru_pos = 2; /* skip past the previous document */ + else + mru_pos += 1;
if (! switch_dialog) switch_dialog = create_switch_dialog(); @@ -1576,6 +1580,7 @@
if (! DOC_VALID(last_doc)) { + utils_beep(); mru_pos = 0; last_doc = g_queue_peek_nth(mru_docs, mru_pos); }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.