summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorMarkus F.X.J. Oberhumer <markus@oberhumer.com>2021-04-27 13:07:06 +0200
committerMarkus F.X.J. Oberhumer <markus@oberhumer.com>2021-04-30 19:42:08 +0200
commite57fe4fb900491688c9f84c18ac5d893a607119b (patch)
treeb345e12ab18e5ad2f8f5fcd7e9e44440d89b1bce /src/input_handler.cc
parente04cc1b4c8158ad3848ddc4eba775f9d6a514b5e (diff)
Improve prompt handling
As a long time vi user I find it highly irritating that you cannot backspace out of the command prompt.
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index e2c1bb17..fde468d5 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -807,7 +807,8 @@ public:
m_callback(line, PromptEvent::Validate, context());
return;
}
- else if (key == Key::Escape or key == ctrl('c'))
+ else if (key == Key::Escape or key == ctrl('c') or
+ ((key == Key::Backspace or key == ctrl('h')) and line.empty()))
{
history_push(line);
context().print_status(DisplayLine{});