summaryrefslogtreecommitdiff
path: root/src/insert_completer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/insert_completer.cc')
-rw-r--r--src/insert_completer.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/insert_completer.cc b/src/insert_completer.cc
index c50fbe00..3e1bcd2d 100644
--- a/src/insert_completer.cc
+++ b/src/insert_completer.cc
@@ -403,7 +403,10 @@ InsertCompletion complete_line(const SelectionList& sels,
}
InsertCompleter::InsertCompleter(Context& context)
- : m_context(context), m_options(context.options()), m_faces(context.faces())
+ : m_context(context),
+ // local scopes might go away before completion ends, make sure to register on a long lived one
+ m_options(context.scope(false).options()),
+ m_faces(context.scope(false).faces())
{
m_options.register_watcher(*this);
}