summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-11-28 18:44:42 +0000
committerMaxime Coste <frrrwww@gmail.com>2013-11-28 18:48:09 +0000
commit50325e62b06c4df3c428a19166b45b95e78511c1 (patch)
tree8cc36296e8cd365efefb5d628386717be7ffe6ce /src/input_handler.cc
parentb83414ddf7f49184acd62df2672def0b3c1f8ea5 (diff)
fix prompt completion handling misbehaving with history
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index 81de3d72..b8c4470f 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -386,6 +386,9 @@ public:
break;
}
} while (it != history.begin());
+
+ clear_completions();
+ showcompl = true;
}
}
else if (key == Key::Down or key == ctrl('n')) // next
@@ -402,6 +405,9 @@ public:
m_line_editor.reset(*m_history_it);
else
m_line_editor.reset(m_prefix);
+
+ clear_completions();
+ showcompl = true;
}
}
else if (key == ctrl('i') or key == Key::BackTab) // tab completion
@@ -455,9 +461,7 @@ public:
else
{
m_line_editor.handle_key(key);
- m_current_completion = -1;
- if (context().has_ui())
- context().ui().menu_hide();
+ clear_completions();
showcompl = true;
}
@@ -502,6 +506,13 @@ private:
} catch (runtime_error&) {}
}
+ void clear_completions()
+ {
+ m_current_completion = -1;
+ if (context().has_ui())
+ context().ui().menu_hide();
+ }
+
void display() const
{
auto display_line = m_line_editor.build_display_line();