diff options
author | Jakub Leszczak <szatan@gecc.xyz> | 2020-05-06 13:36:59 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2020-05-12 15:38:17 +0200 |
commit | 045a0fab4f80b57f4a982ae6bc5f33fe21d66111 (patch) | |
tree | d123b77bfc535f284a209fcd83659a9711f8ac0b | |
parent | 9c30066e73f0105c3fccb7582c8172d5117857b3 (diff) | |
download | st-patched-045a0fab4f80b57f4a982ae6bc5f33fe21d66111.tar.bz2 st-patched-045a0fab4f80b57f4a982ae6bc5f33fe21d66111.tar.xz st-patched-045a0fab4f80b57f4a982ae6bc5f33fe21d66111.zip |
Fix selection: selscroll
-rw-r--r-- | st.c | 26 |
1 files changed, 8 insertions, 18 deletions
@@ -1106,27 +1106,17 @@ selscroll(int orig, int n) | |||
1106 | if (sel.ob.x == -1) | 1106 | if (sel.ob.x == -1) |
1107 | return; | 1107 | return; |
1108 | 1108 | ||
1109 | if (BETWEEN(sel.ob.y, orig, term.bot) || BETWEEN(sel.oe.y, orig, term.bot)) { | 1109 | if (BETWEEN(sel.nb.y, orig, term.bot) != BETWEEN(sel.ne.y, orig, term.bot)) { |
1110 | if ((sel.ob.y += n) > term.bot || (sel.oe.y += n) < term.top) { | 1110 | selclear(); |
1111 | } else if (BETWEEN(sel.nb.y, orig, term.bot)) { | ||
1112 | sel.ob.y += n; | ||
1113 | sel.oe.y += n; | ||
1114 | if (sel.ob.y < term.top || sel.ob.y > term.bot || | ||
1115 | sel.oe.y < term.top || sel.oe.y > term.bot) { | ||
1111 | selclear(); | 1116 | selclear(); |
1112 | return; | ||
1113 | } | ||
1114 | if (sel.type == SEL_RECTANGULAR) { | ||
1115 | if (sel.ob.y < term.top) | ||
1116 | sel.ob.y = term.top; | ||
1117 | if (sel.oe.y > term.bot) | ||
1118 | sel.oe.y = term.bot; | ||
1119 | } else { | 1117 | } else { |
1120 | if (sel.ob.y < term.top) { | 1118 | selnormalize(); |
1121 | sel.ob.y = term.top; | ||
1122 | sel.ob.x = 0; | ||
1123 | } | ||
1124 | if (sel.oe.y > term.bot) { | ||
1125 | sel.oe.y = term.bot; | ||
1126 | sel.oe.x = term.col; | ||
1127 | } | ||
1128 | } | 1119 | } |
1129 | selnormalize(); | ||
1130 | } | 1120 | } |
1131 | } | 1121 | } |
1132 | 1122 | ||