From bd0805cf3ea1711884e176a61da074a726ae19f5 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 1 Oct 2012 14:23:04 +0200 Subject: [PATCH] autoenable word completion while inserting --- src/client.cc | 7 +++++++ src/editor.hh | 1 + 2 files changed, 8 insertions(+) diff --git a/src/client.cc b/src/client.cc index dc6f7310..62c52764 100644 --- a/src/client.cc +++ b/src/client.cc @@ -438,6 +438,13 @@ public: break; default: m_inserter.insert(String() + key.key); + if (m_inserter.editor().selections().size() == 1 and + is_word(key.key)) + { + m_completer.reset(context); + reset_completer = false; + m_completer.select(context, 0); + } } break; case Key::Modifiers::Control: diff --git a/src/editor.hh b/src/editor.hh index c16a60fc..9d3732da 100644 --- a/src/editor.hh +++ b/src/editor.hh @@ -125,6 +125,7 @@ public: void move_cursors(const BufferCoord& offset); Buffer& buffer() const { return m_editor.buffer(); } + Editor& editor() const { return m_editor; } private: InsertMode m_mode;