aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2016-06-01 19:56:45 +0200
committerBoris Faure <billiob@gmail.com>2016-06-01 19:56:45 +0200
commit9e80988f5a24afbf58e7cc5330d6d6a325c126f5 (patch)
tree15d87320fd9a88fe37465b31d0332c65d0b7981d
parentskip 0-width spaces. Closes T3734 (diff)
downloadterminology-9e80988f5a24afbf58e7cc5330d6d6a325c126f5.tar.gz
keys: add Shift+End to reset scroll. Closes https://phab.enlightenment.org/T3582
-rw-r--r--README1
-rw-r--r--man/terminology.14
-rw-r--r--src/bin/config.c6
-rw-r--r--src/bin/keyin.c13
4 files changed, 23 insertions, 1 deletions
diff --git a/README b/README
index 5bdac3b..ee61d6f 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 8923075..148f9fe 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 fabfbe4..9d9b28c 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 e50be51..f5e6d3e 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},