From 5b23cbceb21895ed21eb10202230d157aedef773 Mon Sep 17 00:00:00 2001 From: uint Date: Mon, 22 Dec 2025 13:09:34 +0000 Subject: add floating patch --- config.def.h | 4 ++-- config.h | 8 ++++---- float.patch | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ st | Bin 0 -> 106136 bytes st.c | 10 +++++----- st.h | 6 +++--- st.o | Bin 0 -> 82792 bytes x.o | Bin 0 -> 73984 bytes 8 files changed, 66 insertions(+), 14 deletions(-) create mode 100644 float.patch create mode 100755 st create mode 100644 st.o create mode 100644 x.o 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/config.h b/config.h index 1307d00..114c083 100644 --- a/config.h +++ b/config.h @@ -5,8 +5,8 @@ * * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html */ -static char *font = "Gallant12:pixelsize=16:antialias=true:autohint=true"; -static int borderpx = 2; +static char *font = "Gallant12:pixelsize=22:antialias=true:autohint=true"; +static int borderpx = 20; /* * What program is execed by st depends of these precedence rules: @@ -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/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); diff --git a/st b/st new file mode 100755 index 0000000..fbed567 Binary files /dev/null and b/st differ diff --git a/st.c b/st.c index af45169..b034844 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); diff --git a/st.h b/st.h index 3cea73b..3182fce 100644 --- a/st.h +++ b/st.h @@ -23,10 +23,10 @@ enum glyph_attribute { ATTR_NULL = 0, - ATTR_BOLD = 1 << 0, + ATTR_BOLD = 0 << 0, ATTR_FAINT = 1 << 1, - ATTR_ITALIC = 1 << 2, - ATTR_UNDERLINE = 1 << 3, + ATTR_ITALIC = 0 << 2, + ATTR_UNDERLINE = 0 << 3, ATTR_BLINK = 1 << 4, ATTR_REVERSE = 1 << 5, ATTR_INVISIBLE = 1 << 6, diff --git a/st.o b/st.o new file mode 100644 index 0000000..9125907 Binary files /dev/null and b/st.o differ diff --git a/x.o b/x.o new file mode 100644 index 0000000..b040c84 Binary files /dev/null and b/x.o differ -- cgit v1.2.3