From 9e80988f5a24afbf58e7cc5330d6d6a325c126f5 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Wed, 1 Jun 2016 19:56:45 +0200 Subject: [PATCH] keys: add Shift+End to reset scroll. Closes T3582 --- README | 1 + man/terminology.1 | 4 ++++ src/bin/config.c | 6 +++++- src/bin/keyin.c | 13 +++++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/README b/README index 5bdac3b9..ee61d6fe 100644 --- a/README +++ b/README @@ -41,6 +41,7 @@ Shift+PgDn = Scroll 1 page down Shift+Up = Scroll 1 line up Shift+Down = Scroll 1 line down Shift+Home = Scroll to the top of the backlog +Shift+End = Reset scroll Shift+Left = switch focus to previous terminal inside a window Shift+Right = switch focus to next terminal inside a window Shift+Insert = Paste Clipboard (ctrl+v/c) selection diff --git a/man/terminology.1 b/man/terminology.1 index 89230755..148f9fe2 100644 --- a/man/terminology.1 +++ b/man/terminology.1 @@ -200,6 +200,10 @@ Scroll terminology one line down Scroll terminology to the top of the backlog . .TP +.B Shift+End +Reset scroll in terminology. +. +.TP .B Shift+Left Switch focus to previous terminal inside a window when using splits, or the previous tab. diff --git a/src/bin/config.c b/src/bin/config.c index fabfbe49..9d9b28c3 100644 --- a/src/bin/config.c +++ b/src/bin/config.c @@ -7,7 +7,7 @@ #include "col.h" #include "utils.h" -#define CONF_VER 13 +#define CONF_VER 14 #define LIM(v, min, max) {if (v >= max) v = max; else if (v <= min) v = min;} @@ -365,6 +365,7 @@ _add_default_keys(Config *config) ADD_KB("Left", 0, 0, 1, 0, "term_prev"); ADD_KB("Right", 0, 0, 1, 0, "term_next"); ADD_KB("Home", 0, 0, 1, 0, "top_backlog"); + ADD_KB("End", 0, 0, 1, 0, "reset_scroll"); } void @@ -607,6 +608,9 @@ config_load(const char *key) case 12: _add_key(config, "Home", 0, 0, 1, 0, "top_backlog"); /*pass through*/ + case 13: + _add_key(config, "End", 0, 0, 1, 0, "reset_scroll"); + /*pass through*/ case CONF_VER: /* 13 */ config->version = CONF_VER; break; diff --git a/src/bin/keyin.c b/src/bin/keyin.c index e50be510..f5e6d3ee 100644 --- a/src/bin/keyin.c +++ b/src/bin/keyin.c @@ -615,6 +615,18 @@ cb_scroll_top_backlog(Evas_Object *termio_obj) return EINA_TRUE; } +static Eina_Bool +cb_scroll_reset(Evas_Object *termio_obj) +{ + Termpty *ty = termio_pty_get(termio_obj); + + if (!ty || ty->altbuf) + return EINA_FALSE; + + termio_scroll_set(termio_obj, 0); + return EINA_TRUE; +} + static Shortcut_Action _actions[] = { @@ -624,6 +636,7 @@ static Shortcut_Action _actions[] = {"one_line_up", gettext_noop("Scroll one line up"), cb_scroll_up_line}, {"one_line_down", gettext_noop("Scroll one line down"), cb_scroll_down_line}, {"top_backlog", gettext_noop("Go to the top of the backlog"), cb_scroll_top_backlog}, + {"reset_scroll", gettext_noop("Reset scroll"), cb_scroll_reset}, {"group", gettext_noop("Copy/Paste"), NULL}, {"copy_primary", gettext_noop("Copy selection to Primary buffer"), cb_copy_primary},