if (ename) setenv(ename, value, 1);
}
-void win_update(int ms) {
- if (job_poll(ms))
- xupdate(NULL);
-}
-
void win_loop(void) {
X.running = True;
XMapWindow(X.display, X.self);
tide_send("ADD");
job_spawn(ConnectionNumber(X.display), xupdate, 0, 0);
- while (X.running) {
- win_update(Timeout);
- }
+ while (X.running)
+ if (job_poll(Timeout))
+ xupdate(NULL);
}
void win_quit(void) {
char* path = realpath(*argv, NULL);
if (!path) path = *argv; /* if file doesnt exist, use the original name */
view_init(win_view(EDIT), path);
- if (line_num) view_setln(win_view(EDIT), line_num);
+ view_setln(win_view(EDIT), line_num);
win_title(path);
win_prop_set("FILE", "file", path);
}