summaryrefslogtreecommitdiffstats
path: root/st.c
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2020-11-01 02:34:44 -0500
committerMalfurious <m@lfurio.us>2024-08-12 13:17:24 -0400
commit97307150b7686a74672862f6ff43dd352feaa319 (patch)
tree8d2b0e76c1ca44fc816458c9c3dbe02f7568be1c /st.c
parent9e01794d64ea08d09891adb843d7f11a0ec5bee8 (diff)
downloadst-master.tar.gz
st-master.zip
patch: selection-unfuckHEADmaster
This patch addresses two issues with selections in st. First, the SelectionClear signal from X is no longer ignored. So, if another selection is made in another window, st's selection will disappear. Second (and this one is more of a personal preference), new selections that begin after the end of a line are now considered to begin at the start of the following line. This makes selecting a group of lines easier for either copy/paste or readability in the terminal. Previously, the newline character from the preceeding line would be included in the clipboard and the dead-space at the end of that line would be highlighted.
Diffstat (limited to 'st.c')
-rw-r--r--st.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/st.c b/st.c
index 0ebd3fb..4215059 100644
--- a/st.c
+++ b/st.c
@@ -495,7 +495,10 @@ selnormalize(void)
return;
i = tlinelen(sel.nb.y);
if (i < sel.nb.x)
- sel.nb.x = i;
+ {
+ sel.nb.x = 0;
+ sel.nb.y++;
+ }
if (tlinelen(sel.ne.y) <= sel.ne.x)
sel.ne.x = term.col - 1;
}