]> git.mdlowis.com Git - projs/tide.git/commitdiff
Renamed some tags to shorter names
authorMichael D. Lowis <mike.lowis@gentex.com>
Tue, 27 Mar 2018 12:58:46 +0000 (08:58 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Tue, 27 Mar 2018 12:58:46 +0000 (08:58 -0400)
lib/config.c
lib/job.c
tide.c

index 8cc764e4afc41708a9ea0ea97c365e48efdfcc7f..f42c8f738e4f9489fc915ae9b738736c0af81b30 100644 (file)
@@ -14,7 +14,7 @@ enum { OFF = 0, ON = 1 };
     #define LNSPACE 1
 #endif
 
-char TagString[] = "Quit Save Undo Redo Cut Copy Paste | Find ";
+char TagString[] = "Del Put Undo Redo Find ";
 char FontString[] = FONT;
 
 int /* Integer config options */
index 88cdc13403bec85c0f5ef72bd3b18d03ad21932b..171a256367f40b9761db20a944235c6596a82c38 100644 (file)
--- a/lib/job.c
+++ b/lib/job.c
@@ -30,9 +30,9 @@ bool job_poll(int ms) {
         if (JobFds[njobs].events) njobs++;
     }
     /* Poll until a job is ready, call the functions based on events */
-    printf("poll(..., %d, %d)", njobs, ms);
+    //printf("poll(..., %d, %d)", njobs, ms);
     long ret = poll(JobFds, njobs, ms);
-    printf(" => %ld\n", ret);
+    //printf(" => %ld\n", ret);
     for (int i = 0; i < njobs; i++)
         job_process(JobFds[i].fd, JobFds[i].revents);
     /* reap zombie processes */
diff --git a/tide.c b/tide.c
index 1ba6396a9e06dae06e4deb360062a99cfbd259e4..8d3f7750967038b7d61b16b497fb82c38b11cf5b 100644 (file)
--- a/tide.c
+++ b/tide.c
@@ -340,18 +340,20 @@ static bool changed_externally(Buf* buf) {
     return modified;
 }
 
-static void overwrite(void) {
+static void put(char* arg) {
     trim_whitespace();
-    win_save(NULL);
+    win_save(arg);
 }
 
 static void save(void) {
-    if (!changed_externally(win_buf(EDIT)))
-        overwrite();
+    put(NULL);
 }
 
-static void reload(void) {
-    view_reload(win_view(EDIT));
+static void get(char* arg) {
+    if (arg)
+        view_init(win_view(EDIT), arg, ondiagmsg);
+    else
+        view_reload(win_view(EDIT));
 }
 
 /* Mouse Handling
@@ -397,10 +399,6 @@ void onmouseright(WinRegion id, bool pressed, size_t row, size_t col) {
 
 /* Keyboard Handling
  ******************************************************************************/
-static void saveas(char* arg) {
-    win_save(arg);
-}
-
 static void tag_undo(void) {
     view_undo(win_view(EDIT));
 }
@@ -522,17 +520,15 @@ static void highlight(void) {
 static Tag Builtins[] = {
     { .tag = "Cut",       .action.noarg = cut       },
     { .tag = "Copy",      .action.noarg = copy      },
+    { .tag = "Del",       .action.noarg = quit      },
     { .tag = "Eol",       .action.noarg = eol_mode  },
     { .tag = "Find",      .action.arg   = find      },
     { .tag = "GoTo",      .action.arg   = jump_to   },
+    { .tag = "Get",       .action.arg   = get       },
     { .tag = "Indent",    .action.noarg = indent    },
-    { .tag = "Overwrite", .action.noarg = overwrite },
     { .tag = "Paste",     .action.noarg = paste     },
-    { .tag = "Quit",      .action.noarg = quit      },
+    { .tag = "Put",       .action.arg   = put       },
     { .tag = "Redo",      .action.noarg = tag_redo  },
-    { .tag = "Reload",    .action.noarg = reload    },
-    { .tag = "Save",      .action.noarg = save      },
-    { .tag = "SaveAs",    .action.arg   = saveas    },
     { .tag = "Tabs",      .action.noarg = tabs      },
     { .tag = "Undo",      .action.noarg = tag_undo  },
     { .tag = NULL,        .action.noarg = NULL      }