summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux2014-08-28 16:01:58 -0400
committerQuentin Carbonneaux2014-08-28 17:34:04 -0400
commit5d0c015aa9c723045e03b32ef8268bae5f4e5860 (patch)
treeff2debab3e7c858f32e370b9cac5eff71d6a18e7
parent7db6832e6ef836d0443c5dd8719e6a4dc8bdece8 (diff)
style fixes in main module
-rw-r--r--main.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/main.c b/main.c
index 3ed8cac..07ed5ba 100644
--- a/main.c
+++ b/main.c
@@ -28,11 +28,15 @@ gev(int fd, int flag, void *unused)
static unsigned selbeg;
static W *mousewin;
static int resizing;
- unsigned pos, ne;
+ unsigned pos;
GEvent e;
(void)fd; (void)flag; (void)unused;
- for (ne = 0; g->nextevent(&e) != 0; ne |= 1) {
+ while (g->nextevent(&e)) {
+ if (!needsredraw) {
+ ev_alarm(RedrawDelay, redraw);
+ needsredraw = 1;
+ }
switch (e.type) {
case GResize:
win_resize_frame(e.resize.width, e.resize.height);
@@ -40,11 +44,10 @@ gev(int fd, int flag, void *unused)
case GKey:
cmd_parse(e.key);
win_update(curwin);
- if (!scrolling) {
- if (curwin->cu >= curwin->l[curwin->nl]
- || curwin->cu < curwin->l[0])
- win_show_cursor(curwin, CMid);
- }
+ if (!scrolling)
+ if (curwin->cu >= curwin->l[curwin->nl]
+ || curwin->cu < curwin->l[0])
+ win_show_cursor(curwin, CMid);
scrolling = 0;
break;
case GMouseDown:
@@ -98,10 +101,6 @@ gev(int fd, int flag, void *unused)
curwin->cu = pos;
curwin->rev = 0;
}
- if (ne && !needsredraw) {
- ev_alarm(RedrawDelay, redraw);
- needsredraw = 1;
- }
return 0;
}