summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormbkma <[email protected]>2020-12-23 16:31:39 +0100
committerRobert Antoni Buj Gelonch <[email protected]>2020-12-24 16:54:25 +0100
commit9249657441df18630dbcb71b212d36af9a346c4e (patch)
treeef2c7363734913189ed429a3242a37333b4d5966
parentbfb7205bb9fd8e54e2968c2967db93f6287c2279 (diff)
downloadpluma-9249657441df18630dbcb71b212d36af9a346c4e.tar.bz2
pluma-9249657441df18630dbcb71b212d36af9a346c4e.tar.xz
add show/hide line-numbers shortcut (ctrl+y)
-rw-r--r--help/C/index.docbook30
-rw-r--r--pluma/pluma-window.c4
2 files changed, 34 insertions, 0 deletions
diff --git a/help/C/index.docbook b/help/C/index.docbook
index 5961f617..201a6620 100644
--- a/help/C/index.docbook
+++ b/help/C/index.docbook
@@ -1320,6 +1320,36 @@
</tgroup>
</informaltable>
+ <!-- ============= View ======================= -->
+ <bridgehead>View</bridgehead>
+ <para>Shortcuts for the current view:</para>
+ <informaltable frame="all">
+ <tgroup cols="2" colsep="1" rowsep="1">
+ <colspec colname="COLSPEC0" colwidth="50*"/>
+ <colspec colname="COLSPEC1" colwidth="50*"/>
+ <thead>
+ <row valign="top">
+ <entry colname="COLSPEC0">
+ <para>Shortcut Key</para>
+ </entry>
+ <entry colname="COLSPEC1" align="left">
+ <para>Command</para>
+ </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row valign="top">
+ <entry>
+ <para>Ctrl + Y</para>
+ </entry>
+ <entry>
+ <para>Show/hide line numbers.</para>
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+
<!-- ============= Panes ======================= -->
<bridgehead>Panes</bridgehead>
<para>Shortcuts for showing and hiding panes:</para>
diff --git a/pluma/pluma-window.c b/pluma/pluma-window.c
index fae01e60..58d3fcf7 100644
--- a/pluma/pluma-window.c
+++ b/pluma/pluma-window.c
@@ -348,6 +348,10 @@ pluma_window_key_press_event (GtkWidget *widget,
g_free (tmp);
}
}
+ else if (event->keyval == GDK_KEY_y)
+ {
+ g_settings_set_boolean (settings, PLUMA_SETTINGS_DISPLAY_LINE_NUMBERS, !g_settings_get_boolean (settings, PLUMA_SETTINGS_DISPLAY_LINE_NUMBERS));
+ }
if (g_settings_get_boolean (settings, PLUMA_SETTINGS_CTRL_TABS_SWITCH_TABS))
{