summaryrefslogtreecommitdiff
path: root/src/calcurse.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2013-07-17 00:37:07 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2013-07-17 14:03:53 +0200
commitc4dae80dd23989d4146475de3d16d1636b190c9d (patch)
treecca4767a14af66639ceead8f85dc8d1d12ca7090 /src/calcurse.c
parent5c6131d5eca9910e06e14b0b2c4b72a21ef2e4b4 (diff)
downloadcalcurse-c4dae80dd23989d4146475de3d16d1636b190c9d.zip
Add command prompt
This adds support for vim-style command mode. The command mode can be entered with pressing ":" (by default, the key binding is configurable). Currently, no command is supported. Support for various commands will be added later. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/calcurse.c')
-rw-r--r--src/calcurse.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/calcurse.c b/src/calcurse.c
index 0247ba0..460f4c4 100644
--- a/src/calcurse.c
+++ b/src/calcurse.c
@@ -488,6 +488,17 @@ static inline void key_generic_quit(void)
}
}
+static inline void key_generic_cmd(void)
+{
+ char cmd[BUFSIZ] = "";
+
+ status_mesg(_("Command:"), "");
+ if (getstring(win[STA].p, cmd, BUFSIZ, 0, 1) != GETSTRING_VALID)
+ return;
+
+ wins_update(FLAG_STA);
+}
+
/*
* Calcurse is a text-based personal organizer which helps keeping track
* of events and everyday tasks. It contains a calendar, a 'todo' list,
@@ -659,6 +670,7 @@ int main(int argc, char **argv)
HANDLE_KEY(KEY_GENERIC_SCROLL_UP, key_generic_scroll_up);
HANDLE_KEY(KEY_GENERIC_SCROLL_DOWN, key_generic_scroll_down);
HANDLE_KEY(KEY_GENERIC_QUIT, key_generic_quit);
+ HANDLE_KEY(KEY_GENERIC_CMD, key_generic_cmd);
case KEY_RESIZE:
case ERR: