InputHandler: do not put empty lines in history
This commit is contained in:
parent
18aac3d4e8
commit
c451dd07c6
|
@ -293,11 +293,13 @@ public:
|
||||||
}
|
}
|
||||||
else if (key == Key{Key::Modifiers::Control, 'm'}) // enter
|
else if (key == Key{Key::Modifiers::Control, 'm'}) // enter
|
||||||
{
|
{
|
||||||
std::vector<String>::iterator it;
|
if (not line.empty())
|
||||||
while ((it = find(history, line)) != history.end())
|
{
|
||||||
history.erase(it);
|
std::vector<String>::iterator it;
|
||||||
|
while ((it = find(history, line)) != history.end())
|
||||||
history.push_back(line);
|
history.erase(it);
|
||||||
|
history.push_back(line);
|
||||||
|
}
|
||||||
context().ui().print_status("");
|
context().ui().print_status("");
|
||||||
context().ui().menu_hide();
|
context().ui().menu_hide();
|
||||||
reset_normal_mode();
|
reset_normal_mode();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user