From 560e3631ec57d34c679e6b0faec1e0efdd18d915 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 10 Aug 2024 11:26:26 +1000 Subject: Move debug utils to debug.hh/debug.cc Lots of code includes buffer_utils.hh just for write_to_debug_buffer which pulls many unnecessary dependencies. Reorganise to reduce compile times. --- src/insert_completer.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'src/insert_completer.cc') diff --git a/src/insert_completer.cc b/src/insert_completer.cc index 73c08a43..b369359a 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" -- cgit v1.2.3 From 64ed046e5a841520506e1954ff0bd756ea112d94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Arrufat?= Date: Fri, 16 Aug 2024 08:49:19 +0900 Subject: include headers cleanup --- src/insert_completer.cc | 1 - 1 file changed, 1 deletion(-) (limited to 'src/insert_completer.cc') diff --git a/src/insert_completer.cc b/src/insert_completer.cc index b369359a..1e83a47e 100644 --- a/src/insert_completer.cc +++ b/src/insert_completer.cc @@ -17,7 +17,6 @@ #include "utf8_iterator.hh" #include "user_interface.hh" -#include #include namespace Kakoune -- cgit v1.2.3 From c1ce1d70146dd4b3cda76adc98bfac90da55d18c Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 2 Sep 2024 20:35:07 +1000 Subject: Explicitely call try_accept on InsertCompleter Calling it as part of the insert method was error prone and often led to slightly surprising behaviour, such as the hiding the menu on . --- src/insert_completer.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/insert_completer.cc') diff --git a/src/insert_completer.cc b/src/insert_completer.cc index 1e83a47e..49bbd4ca 100644 --- a/src/insert_completer.cc +++ b/src/insert_completer.cc @@ -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(); } -- cgit v1.2.3