* tide: Line - Get the current line number(s) containing the selection
* tide: Kill - add a 'Kill' tag to kill the most recent job
* tide: gap buffer does not handle UTF-8 currently
-* edit: hangs after launching an empty tide instance then trying to open already open file
## BACKLOG
+#include <stdc.h>
#include <x11.h>
#include <unistd.h>
#include "config.h"
}
void win_add(XConf* x, Window id) {
+ char* path = readprop(x, id, "FILE", 0);
+ if (!path) return;
TWindow* win = calloc(1, sizeof(TWindow));
win->win = id;
win->next = Windows;
- win->path = readprop(x, id, "FILE", 0);
+ win->path = path;
Windows = win;
}
if (!path) return;
/* search for an existing window */
for (TWindow* win = Windows; win; win = win->next) {
- if (!strcmp(win->path, path)) {
+ if (win->path && !strcmp(win->path, path)) {
win_send(x, win->win, x->root, SubstructureRedirectMask|SubstructureNotifyMask, "_NET_ACTIVE_WINDOW", 0);
XMapRaised(x->display, win->win);
win_send(x, x->self, win->win, 0, "GOTO", strtoul(addr, NULL, 0));
return 0;
}
-int main(void) {
- if (daemonize() != 0) return 1;
+char* ARGV0;
+int Foreground = 0;
+
+int main(int argc, char** argv) {
+ OPTBEGIN {
+ case 'F': Foreground = 1; break;
+ } OPTEND;
+ if (!Foreground && daemonize() != 0) return 1;
XConf x = {0};
x11_init(&x);
x11_mkwin(&x, 1, 1, PropertyChangeMask);