From: Michael D. Lowis Date: Thu, 24 Nov 2016 17:34:53 +0000 (-0500) Subject: general cleanup X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=0ae2b66fe0ef070ca46e04d92bda03a9b9c79151;p=projs%2Ftide.git general cleanup --- diff --git a/libedit/utils.c b/libedit/utils.c index 4aae69f..154b34b 100644 --- a/libedit/utils.c +++ b/libedit/utils.c @@ -10,20 +10,6 @@ #include #include -#ifdef __MACH__ -#define CLOCK_MONOTONIC 0 -// clock_gettime is not implemented on OSX (supposedly added on macOS) -int clock_gettime(int id, struct timespec* t) { - (void)id; - struct timeval now; - int rv = gettimeofday(&now, NULL); - if (rv) return rv; - t->tv_sec = now.tv_sec; - t->tv_nsec = now.tv_usec * 1000; - return 0; -} -#endif - uint32_t getmillis(void) { struct timespec time; clock_gettime(CLOCK_MONOTONIC, &time); diff --git a/libx/x11.c b/libx/x11.c index fd1e167..ec77fc0 100644 --- a/libx/x11.c +++ b/libx/x11.c @@ -67,7 +67,7 @@ void x11_init(XConfig* cfg) { /* open the X display and get basic attributes */ Config = cfg; if (!(X.display = XOpenDisplay(0))) - assert(false); + die("could not open display"); X.root = DefaultRootWindow(X.display); XWindowAttributes wa; XGetWindowAttributes(X.display, X.root, &wa); diff --git a/xedit.c b/xedit.c index 236969b..8be1369 100644 --- a/xedit.c +++ b/xedit.c @@ -420,7 +420,6 @@ static void search(void) { char* str = view_getstr(currview(), NULL); view_findstr(getview(EDIT), str); free(str); - Focused = EDIT; } static void find(char* arg) { @@ -455,9 +454,9 @@ static void mouse_middle(enum RegionId id, size_t count, size_t row, size_t col) } else { /* if it isn't then check the tags buffer selection */ arg = view_getstr(getview(TAGS), NULL); + /* if we still haven't found it, check the edit buffer selection */ + if (!arg) arg = view_getstr(getview(EDIT), NULL); } - /* if we still haven't found it, check the edit buffer selection */ - if (!arg) arg = view_getstr(getview(EDIT), NULL); tag_handler(tag, arg); free(str); free(arg);