summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorJohannes Altmanninger <aclopte@gmail.com>2022-07-18 23:29:17 +0200
committerJohannes Altmanninger <aclopte@gmail.com>2022-07-22 21:06:33 +0200
commitaa8f29eff11272112b153de95e83978ca6884fac (patch)
tree6b6c00ed040ff6caf607186d54198c7d2bb93169 /src/input_handler.cc
parent47329260da20a87077764a7c7d7e9c91c0b61b2c (diff)
Extract function for parsing completion switches
Both "define-command" and "prompt" use the same logic, so share it. This will make it easy to implement "prompt -menu". This reveals a problem with PromptCompleterAdapter: when converting it to std::function and then to bool, it always evaluates to true because it has an operator(). However, it should evaluate to false if the adaptee holds no valid function (e.g. is a default-constructed std::function). Otherwise we try to call a non-existant function. Tweak PromptCompleterAdapter to work for empty inputs.
Diffstat (limited to 'src/input_handler.cc')
0 files changed, 0 insertions, 0 deletions