scrollback.c (758B)
1 void 2 kscrolldown(const Arg* a) 3 { 4 int n = a->i; 5 6 if (n < 0) 7 n = term.row + n; 8 9 if (n > term.scr) 10 n = term.scr; 11 12 if (term.scr > 0) { 13 term.scr -= n; 14 selscroll(0, -n); 15 tfulldirt(); 16 } 17 18 #if SIXEL_PATCH 19 scroll_images(-1*n); 20 #endif // SIXEL_PATCH 21 22 #if OPENURLONCLICK_PATCH 23 if (n > 0) 24 restoremousecursor(); 25 #endif // OPENURLONCLICK_PATCH 26 } 27 28 void 29 kscrollup(const Arg* a) 30 { 31 int n = a->i; 32 if (n < 0) 33 n = term.row + n; 34 35 if (term.scr + n > term.histn) 36 n = term.histn - term.scr; 37 38 if (!n) 39 return; 40 41 if (term.scr <= HISTSIZE-n) { 42 term.scr += n; 43 selscroll(0, n); 44 tfulldirt(); 45 } 46 47 #if SIXEL_PATCH 48 scroll_images(n); 49 #endif // SIXEL_PATCH 50 51 #if OPENURLONCLICK_PATCH 52 if (n > 0) 53 restoremousecursor(); 54 #endif // OPENURLONCLICK_PATCH 55 }