keys: add Shift+End to reset scroll. Closes T3582

This commit is contained in:
Boris Faure 2016-06-01 19:56:45 +02:00
parent 7d09373c56
commit 9e80988f5a
4 changed files with 23 additions and 1 deletions

1
README
View File

@ -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

View File

@ -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.

View File

@ -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;

View File

@ -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},