Commit 364adbac authored by Behdad Esfahbod's avatar Behdad Esfahbod Committed by Behdad Esfahbod
Browse files

Bug 118967 – single line scrolling with "Ctrl+Shift+ArrowUp/ArrowDown"

2007-11-27  Behdad Esfahbod  <behdad@gnome.org>

        Bug 118967 – single line scrolling with "Ctrl+Shift+ArrowUp/ArrowDown"
        Patch from Mauricio and Mariano Suárez-Alvarez

        * src/vte.c (vte_terminal_scroll_lines),
        (vte_terminal_scroll_pages), (vte_terminal_key_press):
        Implement single-line scroll.


svn path=/trunk/; revision=1998
parent c35a4a89
2007-11-27 Behdad Esfahbod <behdad@gnome.org>
Bug 118967 single line scrolling with "Ctrl+Shift+ArrowUp/ArrowDown"
Patch from Mauricio and Mariano Suárez-Alvarez
* src/vte.c (vte_terminal_scroll_lines),
(vte_terminal_scroll_pages), (vte_terminal_key_press):
Implement single-line scroll.
2007-11-27 Behdad Esfahbod <behdad@gnome.org>
Bug 353610 Don't convert tab characters upon copying
......
......@@ -1766,15 +1766,15 @@ _vte_terminal_adjust_adjustments_full (VteTerminal *terminal)
}
}
/* Scroll up or down in the current screen. */
/* Scroll a fixed number of lines up or down in the current screen. */
static void
vte_terminal_scroll_pages(VteTerminal *terminal, gint pages)
vte_terminal_scroll_lines(VteTerminal *terminal, gint lines)
{
glong destination;
_vte_debug_print(VTE_DEBUG_IO, "Scrolling %d pages.\n", pages);
_vte_debug_print(VTE_DEBUG_IO, "Scrolling %d lines.\n", lines);
/* Calculate the ideal position where we want to be before clamping. */
destination = terminal->pvt->screen->scroll_delta;
destination += pages * terminal->row_count;
destination += lines;
/* Can't scroll past data we have. */
destination = CLAMP(destination,
terminal->adjustment->lower,
......@@ -1784,6 +1784,13 @@ vte_terminal_scroll_pages(VteTerminal *terminal, gint pages)
destination);
}
/* Scroll a fixed number of pages up or down, in the current screen. */
static void
vte_terminal_scroll_pages(VteTerminal *terminal, gint pages)
{
vte_terminal_scroll_lines(terminal, pages * terminal->row_count);
}
/* Scroll so that the scroll delta is the minimum value. */
static void
vte_terminal_maybe_scroll_to_top(VteTerminal *terminal)
......@@ -4375,6 +4382,26 @@ vte_terminal_key_press(GtkWidget *widget, GdkEventKey *event)
}
break;
/* Keypad/motion keys. */
case GDK_KP_Up:
case GDK_Up:
if (terminal->pvt->modifiers & GDK_CONTROL_MASK
&& terminal->pvt->modifiers & GDK_SHIFT_MASK) {
vte_terminal_scroll_lines(terminal, -1);
scrolled = TRUE;
handled = TRUE;
suppress_meta_esc = TRUE;
}
break;
case GDK_KP_Down:
case GDK_Down:
if (terminal->pvt->modifiers & GDK_CONTROL_MASK
&& terminal->pvt->modifiers & GDK_SHIFT_MASK) {
vte_terminal_scroll_lines(terminal, 1);
scrolled = TRUE;
handled = TRUE;
suppress_meta_esc = TRUE;
}
break;
case GDK_KP_Page_Up:
case GDK_Page_Up:
if (terminal->pvt->modifiers & GDK_SHIFT_MASK) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment