aboutsummaryrefslogtreecommitdiffstats
path: root/src/wins.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2014-07-16 23:22:36 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2014-07-16 23:31:31 +0200
commit5aec5408950ed41fad203e749bda225bd3f86a8b (patch)
tree87e49708cb0ab6d8ca92484ac331cd6a42a166a6 /src/wins.c
parente93030befb2aebe94faf5c5455313d312611d7b3 (diff)
downloadcalcurse-5aec5408950ed41fad203e749bda225bd3f86a8b.tar.gz
calcurse-5aec5408950ed41fad203e749bda225bd3f86a8b.zip
Allow for merging data files when reloading
This allows for merging the (unsaved) items with the items from the data files when invoking the reload operation. To this end, an external merge tool (defaults to vimdiff) is used. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/wins.c')
-rw-r--r--src/wins.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/wins.c b/src/wins.c
index d4b93d5..7545a59 100644
--- a/src/wins.c
+++ b/src/wins.c
@@ -611,6 +611,22 @@ void wins_launch_external(const char *file, const char *cmd)
wins_unprepare_external();
}
+/*
+ * While inside interactive mode, launch the external command cmd on the given
+ * two files.
+ */
+void wins_launch_external2(const char *file1, const char *file2,
+ const char *cmd)
+{
+ const char *arg[] = { cmd, file1, file2, NULL };
+ int pid;
+
+ wins_prepare_external();
+ if ((pid = shell_exec(NULL, NULL, *arg, arg)))
+ child_wait(NULL, NULL, pid);
+ wins_unprepare_external();
+}
+
#define NB_CAL_CMDS 28 /* number of commands while in cal view */
#define NB_APP_CMDS 33 /* same thing while in appointment view */
#define NB_TOD_CMDS 32 /* same thing while in todo view */