]> git.mdlowis.com Git - projs/tide.git/commitdiff
minor cleanup
authorMichael D. Lowis <mike@mdlowis.com>
Tue, 27 Mar 2018 02:33:46 +0000 (22:33 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Tue, 27 Mar 2018 02:33:46 +0000 (22:33 -0400)
lib/x11.c
tide.c

index 80d2e572c06ca6dd63542a71e5b49ac0ca3afd62..abcbf554b72e8240c97e39751db47b579efe547d 100644 (file)
--- a/lib/x11.c
+++ b/lib/x11.c
@@ -59,7 +59,6 @@ static void onmousedrag(int state, int x, int y);
 static void onmousebtn(int btn, bool pressed, int x, int y);
 static void onwheelup(WinRegion id, bool pressed, size_t row, size_t col);
 static void onwheeldn(WinRegion id, bool pressed, size_t row, size_t col);
-static void oncommand(char* cmd);
 static void draw_glyphs(size_t x, size_t y, UGlyph* glyphs, size_t rlen, size_t ncols);
 static WinRegion getregion(size_t x, size_t y);
 
@@ -85,7 +84,6 @@ struct XFont {
     int ncached;
 };
 
-static bool Running = true;
 static struct {
     Window root;
     Display* display;
@@ -124,10 +122,6 @@ static Rune LastKey;
 static KeyBinding* Keys = NULL;
 static void (*InputFunc)(Rune);
 
-void x11_deinit(void) {
-    Running = false;
-}
-
 void x11_init(XConfig* cfg) {
     signal(SIGPIPE, SIG_IGN); // Ignore the SIGPIPE signal
     setlocale(LC_CTYPE, "");
@@ -652,17 +646,6 @@ static void onwheeldn(WinRegion id, bool pressed, size_t row, size_t col) {
     view_scroll(win_view(id), +ScrollBy);
 }
 
-static void oncommand(char* cmd) {
-    size_t line = strtoul(cmd, NULL, 0);
-    if (line) {
-        View* view = win_view(EDIT);
-        win_setregion(EDIT);
-        view_setln(view, line);
-        view_eol(view, false);
-        view_selctx(view);
-    }
-}
-
 static void draw_glyphs(size_t x, size_t y, UGlyph* glyphs, size_t rlen, size_t ncols) {
     XGlyphSpec specs[rlen];
     size_t i = 0;
diff --git a/tide.c b/tide.c
index 76a180d9e0e5c2c719832a215bb82e39c03f4d35..1ba6396a9e06dae06e4deb360062a99cfbd259e4 100644 (file)
--- a/tide.c
+++ b/tide.c
@@ -325,11 +325,7 @@ static void quit(void) {
     static uint64_t before = 0;
     uint64_t now = getmillis();
     if (!win_buf(EDIT)->modified || (now-before) <= (uint64_t)ClickTime) {
-        #ifndef TEST
-        x11_deinit();
-        #else
         exit(0);
-        #endif
     } else {
         ondiagmsg("File is modified. Repeat action twice quickly to quit.");
     }