Lines 1917-1920
Link Here
|
1917 |
} |
1917 |
} |
1918 |
|
1918 |
|
|
|
1919 |
/* Scroll up or down in the current screen. */ |
1920 |
static void |
1921 |
vte_terminal_scroll_lines(VteTerminal *terminal, gint lines) |
1922 |
{ |
1923 |
glong destination; |
1924 |
g_return_if_fail(VTE_IS_TERMINAL(terminal)); |
1925 |
#ifdef VTE_DEBUG |
1926 |
if (_vte_debug_on(VTE_DEBUG_IO)) { |
1927 |
fprintf(stderr, "Scrolling %d lines.\n", lines); |
1928 |
} |
1929 |
#endif |
1930 |
/* Calculate the ideal position where we want to be before clamping. */ |
1931 |
destination = floor(gtk_adjustment_get_value(terminal->adjustment)); |
1932 |
destination += lines; |
1933 |
/* Can't scroll past data we have. */ |
1934 |
destination = CLAMP(destination, |
1935 |
terminal->adjustment->lower, |
1936 |
terminal->adjustment->upper - terminal->row_count); |
1937 |
/* Tell the scrollbar to adjust itself. */ |
1938 |
gtk_adjustment_set_value(terminal->adjustment, destination); |
1939 |
/* Clear dingus match set. */ |
1940 |
vte_terminal_match_contents_clear(terminal); |
1941 |
/* Notify viewers that the contents have changed. */ |
1942 |
vte_terminal_emit_contents_changed(terminal); |
1943 |
} |
1944 |
|
1945 |
|
1919 |
/* Scroll so that the scroll delta is the minimum value. */ |
1946 |
/* Scroll so that the scroll delta is the minimum value. */ |
1920 |
static void |
1947 |
static void |
Lines 8038-8041
Link Here
|
8038 |
} |
8065 |
} |
8039 |
break; |
8066 |
break; |
|
|
8067 |
case GDK_KP_Up: |
8068 |
case GDK_Up: |
8069 |
if (terminal->pvt->modifiers & GDK_SHIFT_MASK) { |
8070 |
vte_terminal_scroll_lines(terminal, -1); |
8071 |
scrolled = TRUE; |
8072 |
handled = TRUE; |
8073 |
suppress_meta_esc = TRUE; |
8074 |
} |
8075 |
break; |
8076 |
case GDK_KP_Down: |
8077 |
case GDK_Down: |
8078 |
if (terminal->pvt->modifiers & GDK_SHIFT_MASK) { |
8079 |
vte_terminal_scroll_lines(terminal, 1); |
8080 |
scrolled = TRUE; |
8081 |
handled = TRUE; |
8082 |
suppress_meta_esc = TRUE; |
8083 |
} |
8084 |
break; |
8040 |
case GDK_KP_Home: |
8085 |
case GDK_KP_Home: |
8041 |
case GDK_Home: |
8086 |
case GDK_Home: |