diff options
| author | uint <abhinav.prsai@gmail.com> | 2025-12-22 13:09:34 +0000 |
|---|---|---|
| committer | uint <abhinav.prsai@gmail.com> | 2025-12-22 13:09:34 +0000 |
| commit | 5b23cbceb21895ed21eb10202230d157aedef773 (patch) | |
| tree | d08966e563db99533ebfc16e3625c95056966544 /float.patch | |
| parent | 99de1c3d272ba260c855afc09005f1391582d2a0 (diff) | |
Diffstat (limited to 'float.patch')
| -rw-r--r-- | float.patch | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/float.patch b/float.patch new file mode 100644 index 0000000..e4243dc --- /dev/null +++ b/float.patch @@ -0,0 +1,52 @@ +diff --git a/config.def.h b/config.def.h +index 8b25d40..6769f99 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -201,8 +201,8 @@ static Shortcut shortcuts[] = { + { TERMMOD, XK_Y, selpaste, {.i = 0} }, + { ShiftMask, XK_Insert, selpaste, {.i = 0} }, + { TERMMOD, XK_Num_Lock, numlock, {.i = 0} }, +- { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} }, +- { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} }, ++ { ShiftMask, XK_Page_Up, kscrollup, {.f = -0.1} }, ++ { ShiftMask, XK_Page_Down, kscrolldown, {.f = -0.1} }, + }; + + /* +diff --git a/st.c b/st.c +index a3b3c9d..5a93594 100644 +--- a/st.c ++++ b/st.c +@@ -1087,14 +1087,14 @@ tswapscreen(void) + void + kscrollup(const Arg *a) + { +- int n = a->i; ++ float n = a->f; + + if (IS_SET(MODE_ALTSCREEN)) + return; + +- if (n < 0) n = (-n) * term.row; ++ if (n < 0) n = MAX((-n) * term.row, 1); + if (n > TSCREEN.size - term.row - TSCREEN.off) n = TSCREEN.size - term.row - TSCREEN.off; +- while (!TLINE(-n)) --n; ++ while (!TLINE((int)-n)) --n; + TSCREEN.off += n; + selscroll(0, n); + tfulldirt(); +@@ -1104,12 +1104,12 @@ void + kscrolldown(const Arg *a) + { + +- int n = a->i; ++ float n = a->f; + + if (IS_SET(MODE_ALTSCREEN)) + return; + +- if (n < 0) n = (-n) * term.row; ++ if (n < 0) n = MAX((-n) * term.row, 1); + if (n > TSCREEN.off) n = TSCREEN.off; + TSCREEN.off -= n; + selscroll(0, -n); |
