Add keybinding to open the last closed tab (closes #2912692).

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4519 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2010-01-01 23:20:21 +00:00
parent 7ba4a81181
commit de50230c68
6 changed files with 31 additions and 5 deletions

View File

@ -2,6 +2,9 @@
* *.*:
Update copyright information.
* src/keybindings.c, src/keybindings.h, src/plugindata.h,
doc/geany.txt, doc/geany.html:
Add keybinding to open the last closed tab (closes #2912692).
2009-12-31 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>

View File

@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
<title>Geany</title>
<meta name="authors" content="Enrico Tröger Nick Treleaven Frank Lanitz" />
<meta name="date" content="2009-12-31" />
<meta name="date" content="2010-01-01" />
<style type="text/css">
/*
@ -139,12 +139,12 @@ Stylesheet for Geany's documentation based on a version of John Gabriele.
<br />Nick Treleaven
<br />Frank Lanitz</td></tr>
<tr><th class="docinfo-name">Date:</th>
<td>2009-12-31</td></tr>
<td>2010-01-01</td></tr>
<tr><th class="docinfo-name">Version:</th>
<td>0.19</td></tr>
</tbody>
</table>
<p>Copyright © 2005-2009</p>
<p>Copyright © 2005-2010</p>
<p>This document is distributed under the terms of the GNU General Public
License as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version. A copy of this
@ -3114,6 +3114,14 @@ shortcut.</p>
<td>Ctrl-O (C)</td>
<td>Opens a file.</td>
</tr>
<tr><td>Open selected file</td>
<td>Ctrl-Shift-O</td>
<td>Opens the selected filename.</td>
</tr>
<tr><td>Re-open last closed tab</td>
<td>&nbsp;</td>
<td>Re-opens the last closed document tab.</td>
</tr>
<tr><td>Save</td>
<td>Ctrl-S (C)</td>
<td>Saves the current file.</td>
@ -5849,7 +5857,7 @@ USE OR PERFORMANCE OF THIS SOFTWARE.</p>
<div class="footer">
<hr class="footer" />
<a class="reference external" href="geany.txt">View document source</a>.
Generated on: 2009-12-31 15:43 UTC.
Generated on: 2010-01-01 23:17 UTC.
Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>

View File

@ -2852,6 +2852,10 @@ New Ctrl-N (C) Creates a new file.
Open Ctrl-O (C) Opens a file.
Open selected file Ctrl-Shift-O Opens the selected filename.
Re-open last closed tab Re-opens the last closed document tab.
Save Ctrl-S (C) Saves the current file.
Save As Saves the current file under a new name.

View File

@ -244,6 +244,8 @@ static void init_default_kb(void)
LW(menu_close_all1));
keybindings_set_item(group, GEANY_KEYS_FILE_RELOAD, NULL,
GDK_r, GDK_CONTROL_MASK, "menu_reloadfile", _("Reload file"), LW(menu_reload1));
keybindings_set_item(group, GEANY_KEYS_FILE_OPENLASTTAB, NULL,
0, 0, "file_openlasttab", _("Re-open last closed tab"), NULL);
group = ADD_KB_GROUP(PROJECT, _("Project"), cb_func_project_action);
@ -1330,6 +1332,14 @@ static gboolean cb_func_file_action(guint key_id)
case GEANY_KEYS_FILE_OPENSELECTED:
on_menu_open_selected_file1_activate(NULL, NULL);
break;
case GEANY_KEYS_FILE_OPENLASTTAB:
{
gchar *utf8_filename = g_queue_peek_head(ui_prefs.recent_queue);
gchar *locale_filename = utils_get_locale_from_utf8(utf8_filename);
document_open_file(locale_filename, FALSE, NULL, NULL);
g_free(locale_filename);
break;
}
case GEANY_KEYS_FILE_SAVE:
on_save1_activate(NULL, NULL);
break;

View File

@ -121,6 +121,7 @@ enum
GEANY_KEYS_FILE_CLOSE,
GEANY_KEYS_FILE_CLOSEALL,
GEANY_KEYS_FILE_RELOAD,
GEANY_KEYS_FILE_OPENLASTTAB,
GEANY_KEYS_FILE_COUNT
};

View File

@ -50,7 +50,7 @@
enum {
/** The Application Programming Interface (API) version, incremented
* whenever any plugin data types are modified or appended to. */
GEANY_API_VERSION = 167,
GEANY_API_VERSION = 168,
/** The Application Binary Interface (ABI) version, incremented whenever
* existing fields in the plugin data types have to be changed or reordered. */