From 1f1b1e2151906d904a33d8928f35828488a177d5 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Mon, 28 Mar 2016 22:41:32 +0200 Subject: [PATCH] Move zoom in/out/reset bindings to general Changing the cursor when in command mode, messes up vte's state which causes aborts, misplaced cursor and other bugs. Closes: #194 --- README.rst | 12 ++++++------ man/termite.1 | 12 ++++++------ termite.cc | 18 +++++++++--------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.rst b/README.rst index d170df3..50ba6fe 100644 --- a/README.rst +++ b/README.rst @@ -61,6 +61,12 @@ INSERT MODE +----------------------+---------------------------------------------+ | ``shift-pagedown`` | scroll down a page | +----------------------+---------------------------------------------+ +| ``ctrl-+`` | increase font size | ++----------------------+---------------------------------------------+ +| ``ctrl--`` | decrease font size | ++----------------------+---------------------------------------------+ +| ``ctrl-=`` | reset font size to default | ++----------------------+---------------------------------------------+ .. [1] The directory can be set by a process running in the terminal. For example, with zsh: @@ -142,12 +148,6 @@ SELECTION MODE +-----------------------------------+-----------------------------------------------------------+ | ``N`` | previous search match | +-----------------------------------+-----------------------------------------------------------+ -| ``+`` | increase font size | -+-----------------------------------+-----------------------------------------------------------+ -| ``-`` | decrease font size | -+-----------------------------------+-----------------------------------------------------------+ -| ``=`` | reset font size to default | -+-----------------------------------+-----------------------------------------------------------+ During scrollback search, the current selection is changed to the search match and copied to the PRIMARY clipboard buffer. diff --git a/man/termite.1 b/man/termite.1 index 29acfef..c92ad46 100644 --- a/man/termite.1 +++ b/man/termite.1 @@ -71,6 +71,12 @@ scroll down a line scroll up a page .IP "\fBshift-pagedown\fP" scroll down a page +.IP "\fBctrl-+\fP" +increase font size +.IP "\fBctrl--\fP" +decrease font size +.IP "\fBctrl-=\fP" +reset font size to default .SS Selection Mode In \fBSelection Mode\fP you interact with the interface of \fBtermite\fP and the visual representation of the programs running within it. You can @@ -133,12 +139,6 @@ open the current selection as a url and enter insert mode next search match .IP "\fBN\fP" previous search match -.IP "\fB+\fP" -increase font size -.IP "\fB-\fP" -decrease font size -.IP "\fB=\fP" -reset font size to default .SS Hints Mode The \fBHints Mode\fP is meant for accessing urls outputted to the terminal. diff --git a/termite.cc b/termite.cc index d752083..1e029a1 100644 --- a/termite.cc +++ b/termite.cc @@ -909,20 +909,14 @@ gboolean key_press_cb(VteTerminal *vte, GdkEventKey *event, keybind_info *info) gtk_widget_show(info->panel.da); overlay_show(&info->panel, overlay_mode::urlselect, nullptr); break; - case GDK_KEY_plus: - increase_font_scale(vte); - break; - case GDK_KEY_minus: - decrease_font_scale(vte); - break; - case GDK_KEY_equal: - reset_font_scale(vte, info->config.font_scale); - break; } return TRUE; } if (modifiers == (GDK_CONTROL_MASK|GDK_SHIFT_MASK)) { switch (gdk_keyval_to_lower(event->keyval)) { + case GDK_KEY_plus: + increase_font_scale(vte); + return TRUE; case GDK_KEY_t: launch_in_directory(vte); return TRUE; @@ -959,6 +953,12 @@ gboolean key_press_cb(VteTerminal *vte, GdkEventKey *event, keybind_info *info) case GDK_KEY_Tab: overlay_show(&info->panel, overlay_mode::completion, vte); return TRUE; + case GDK_KEY_minus: + decrease_font_scale(vte); + return TRUE; + case GDK_KEY_equal: + reset_font_scale(vte, info->config.font_scale); + return TRUE; default: if (modify_key_feed(event, info, modify_table)) return TRUE;