summaryrefslogtreecommitdiff
path: root/src/insert_completer.cc
diff options
context:
space:
mode:
authorEnrico Borba <enricozb@users.noreply.github.com>2024-12-23 09:23:58 +0100
committerGitHub <noreply@github.com>2024-12-23 09:23:58 +0100
commit52125e6336d596aebdd4da91080b3178ddca7449 (patch)
tree27d3e5c01660d567f22fee621c97753f294256b0 /src/insert_completer.cc
parent14cb35f62b36b2f1aa530adb5e31c05ff1347bfc (diff)
parent9c458c50661446fc6e7295787b06422137af099d (diff)
Merge branch 'master' into enricozb/daemon-stdin
Diffstat (limited to 'src/insert_completer.cc')
-rw-r--r--src/insert_completer.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/insert_completer.cc b/src/insert_completer.cc
index 73c08a43..49bbd4ca 100644
--- a/src/insert_completer.cc
+++ b/src/insert_completer.cc
@@ -2,6 +2,7 @@
#include "buffer_manager.hh"
#include "buffer_utils.hh"
+#include "debug.hh"
#include "client.hh"
#include "command_manager.hh"
#include "changes.hh"
@@ -16,7 +17,6 @@
#include "utf8_iterator.hh"
#include "user_interface.hh"
-#include <numeric>
#include <utility>
namespace Kakoune
@@ -481,12 +481,12 @@ auto& get_last(BufferRange& range) { return range.end; }
bool InsertCompleter::has_candidate_selected() const
{
- return m_current_candidate >= 0 and m_current_candidate < m_completions.candidates.size() - 1;
+ return m_completions.is_valid() and m_current_candidate >= 0 and m_current_candidate < m_completions.candidates.size() - 1;
}
void InsertCompleter::try_accept()
{
- if (m_completions.is_valid() and has_candidate_selected())
+ if (has_candidate_selected())
reset();
}