From 0cfc8fd2e6216583ad09e2b3bf8102f29b72cd52 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Tue, 27 Mar 2018 08:58:46 -0400 Subject: [PATCH] Renamed some tags to shorter names --- lib/config.c | 2 +- lib/job.c | 4 ++-- tide.c | 26 +++++++++++--------------- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/lib/config.c b/lib/config.c index 8cc764e..f42c8f7 100644 --- a/lib/config.c +++ b/lib/config.c @@ -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 */ diff --git a/lib/job.c b/lib/job.c index 88cdc13..171a256 100644 --- 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 1ba6396..8d3f775 100644 --- 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 } -- 2.52.0