summaryrefslogtreecommitdiff
path: root/src/input_handler.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2016-08-22 20:31:08 +0100
committerMaxime Coste <frrrwww@gmail.com>2016-08-22 20:37:14 +0100
commit911a32a992fb96a23e66eba478c00655703cfed0 (patch)
tree210f6647b759f81d8842f8012ed07e067243c525 /src/input_handler.hh
parentac81d0f39cb1139472b2d2e90156f10324257777 (diff)
Only drop blank prefixed history entries in command/shell prompts
For regex prompts we actually want to save them, as a leading space is significant Fixes #767
Diffstat (limited to 'src/input_handler.hh')
-rw-r--r--src/input_handler.hh11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/input_handler.hh b/src/input_handler.hh
index c4fcb1a3..a26bbbd4 100644
--- a/src/input_handler.hh
+++ b/src/input_handler.hh
@@ -29,6 +29,15 @@ enum class PromptEvent
Validate
};
using PromptCallback = std::function<void (StringView, PromptEvent, Context&)>;
+enum class PromptFlags
+{
+ None = 0,
+ Password = 1 << 0,
+ DropHistoryEntriesWithBlankPrefix = 1 << 1
+};
+template<> struct WithBitOps<PromptFlags> : std::true_type {};
+
+
using KeyCallback = std::function<void (Key, Context&)>;
class InputMode;
@@ -53,7 +62,7 @@ public:
// returns to normal mode after validation if callback does
// not change the mode itself
void prompt(StringView prompt, String initstr,
- Face prompt_face, bool password,
+ Face prompt_face, PromptFlags flags,
Completer completer, PromptCallback callback);
void set_prompt_face(Face prompt_face);