From 911a32a992fb96a23e66eba478c00655703cfed0 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 22 Aug 2016 20:31:08 +0100 Subject: 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 --- src/input_handler.hh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/input_handler.hh') 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; +enum class PromptFlags +{ + None = 0, + Password = 1 << 0, + DropHistoryEntriesWithBlankPrefix = 1 << 1 +}; +template<> struct WithBitOps : std::true_type {}; + + using KeyCallback = std::function; 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); -- cgit v1.2.3