Xinqi Bao's Git
projects
/
st.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
selsnap: simplify SNAP_LINE case
[st.git]
/
st.c
diff --git
a/st.c
b/st.c
index
87f3ed2
..
789e795
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-772,15
+772,15
@@
selsnap(int *x, int *y, int direction) {
* previous line will be selected.
*/
*x = (direction < 0) ? 0 : term.col - 1;
* previous line will be selected.
*/
*x = (direction < 0) ? 0 : term.col - 1;
- if(direction < 0
&& *y > 0
) {
+ if(direction < 0) {
for(; *y > 0; *y += direction) {
if(!(term.line[*y-1][term.col-1].mode
& ATTR_WRAP)) {
break;
}
}
for(; *y > 0; *y += direction) {
if(!(term.line[*y-1][term.col-1].mode
& ATTR_WRAP)) {
break;
}
}
- } else if(direction > 0
&& *y < term.row-1
) {
- for(; *y < term.row; *y += direction) {
+ } else if(direction > 0) {
+ for(; *y < term.row
-1
; *y += direction) {
if(!(term.line[*y][term.col-1].mode
& ATTR_WRAP)) {
break;
if(!(term.line[*y][term.col-1].mode
& ATTR_WRAP)) {
break;