summaryrefslogtreecommitdiff
path: root/src/vars.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/vars.c
parente93030befb2aebe94faf5c5455313d312611d7b3 (diff)
downloadcalcurse-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/vars.c')
-rw-r--r--src/vars.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/vars.c b/src/vars.c
index 52a1ed2..16b892a 100644
--- a/src/vars.c
+++ b/src/vars.c
@@ -126,7 +126,7 @@ struct dmon_conf dmon;
*/
void vars_init(void)
{
- const char *ed, *pg;
+ const char *ed, *pg, *mt;
/* Variables for user configuration */
conf.confirm_quit = 1;
@@ -159,6 +159,11 @@ void vars_init(void)
pg = DEFAULT_PAGER;
conf.pager = pg;
+ mt = getenv("MERGETOOL");
+ if (mt == NULL || mt[0] == '\0')
+ mt = DEFAULT_MERGETOOL;
+ conf.mergetool = mt;
+
wins_set_layout(1);
ui_calendar_set_first_day_of_week(MONDAY);