add $ (EOL) and ^ (BOL) bindings to selection mode

This commit is contained in:
Daniel Micay 2012-07-07 00:10:30 -04:00
parent 07b88a9cfb
commit ac2585297c
2 changed files with 11 additions and 0 deletions

View File

@ -39,6 +39,8 @@ TEXT SELECTION MODE
* ``V``: visual line mode
* ``ctrl-v``: visual block mode
* ``h``/``j``/``k``/``l`` or arrow keys: move cursor left/down/up/right
* ``$``: end-of-line
* ``^``: beginning-of-line
TODO
====

View File

@ -154,6 +154,7 @@ gboolean key_press_cb(VteTerminal *vte, GdkEventKey *event, search_panel_info *i
}
return TRUE;
}
char *eol;
switch (event->keyval) {
case GDK_KEY_Left:
case GDK_KEY_h:
@ -171,6 +172,14 @@ gboolean key_press_cb(VteTerminal *vte, GdkEventKey *event, search_panel_info *i
case GDK_KEY_l:
vte_terminal_feed(vte, CSI "1C", strlen(CSI "1C"));
break;
case GDK_KEY_asciicircum:
vte_terminal_feed(vte, CSI "0G", strlen(CSI "0G"));
break;
case GDK_KEY_dollar:
eol = g_strdup_printf(CSI "%ldG", vte_terminal_get_column_count(vte));
vte_terminal_feed(vte, eol, (long)strlen(eol));
g_free(eol);
break;
case GDK_KEY_v:
toggle_visual(vte, &info->select, SELECT_VISUAL);
break;