summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-02-19 19:04:36 +0100
committerMaxime Coste <frrrwww@gmail.com>2013-02-19 19:04:36 +0100
commitc451dd07c62d025808f9e2023779bb4dbad15d8c (patch)
treea4938a95ce5bea54c3407993d4bcf45836ad8e76 /src/input_handler.cc
parent18aac3d4e80743e5410a4c8ae36c32ba2f7514ae (diff)
InputHandler: do not put empty lines in history
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index be4aa51f..1bd5a988 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -293,11 +293,13 @@ public:
}
else if (key == Key{Key::Modifiers::Control, 'm'}) // enter
{
- std::vector<String>::iterator it;
- while ((it = find(history, line)) != history.end())
- history.erase(it);
-
- history.push_back(line);
+ if (not line.empty())
+ {
+ std::vector<String>::iterator it;
+ while ((it = find(history, line)) != history.end())
+ history.erase(it);
+ history.push_back(line);
+ }
context().ui().print_status("");
context().ui().menu_hide();
reset_normal_mode();