summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux2014-11-24 11:35:10 -0500
committerQuentin Carbonneaux2014-11-24 11:35:10 -0500
commitb1634e68630d9d46af933225858969d6d3e42e48 (patch)
treed633580073b0dc757b0c2c73d640af0daac97552
parent14769dc6357f05fc18c9607515c2312d9b7905a1 (diff)
simplify cursor logic
The cursor is now allowed out of screen, because it costs nothing and it is convenient during resizes. The new code also allows scrolling during selection, this is handy when the selection exceeds a screenful.
-rw-r--r--main.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/main.c b/main.c
index 8140dae..e9de2a7 100644
--- a/main.c
+++ b/main.c
@@ -93,6 +93,7 @@ gev(int fd, int flag, void *unused)
|| curwin->cu < curwin->l[0])
win_show_cursor(curwin, CMid);
scrolling = 0;
+ selbeg = -1u;
break;
case GMouseDown:
mousewin = win_which(e.mouse.x, e.mouse.y);
@@ -149,11 +150,6 @@ gev(int fd, int flag, void *unused)
default:
break;
}
- selbeg = -1u;
- if (curwin->cu >= curwin->l[curwin->nl])
- curwin->cu = curwin->l[curwin->nl-1];
- if (curwin->cu < curwin->l[0])
- curwin->cu = curwin->l[0];
continue;
Setcursor:
curwin->cu = p0;