|
|
|
|
@ -3,7 +3,7 @@
|
|
|
|
|
|
|
|
|
|
Autocomplete::Autocomplete(Source::BaseView *view, bool &interactive_completion, guint &last_keyval, bool pass_buffer_and_strip_word, bool use_thread) |
|
|
|
|
: view(view), interactive_completion(interactive_completion), pass_buffer_and_strip_word(pass_buffer_and_strip_word), use_thread(use_thread) { |
|
|
|
|
view->get_buffer()->signal_changed().connect([this, &last_keyval] { |
|
|
|
|
view->get_buffer()->signal_insert().connect([this, &last_keyval](const Gtk::TextIter & /*iter*/, const Glib::ustring & /*text*/, int /*bytes*/) { |
|
|
|
|
if(CompletionDialog::get() && CompletionDialog::get()->is_visible()) { |
|
|
|
|
cancel_reparse(); |
|
|
|
|
return; |
|
|
|
|
@ -19,6 +19,15 @@ Autocomplete::Autocomplete(Source::BaseView *view, bool &interactive_completion,
|
|
|
|
|
run(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
view->get_buffer()->signal_erase().connect([this](const Gtk::TextIter & /*start*/, const Gtk::TextIter & /*end*/) { |
|
|
|
|
if(CompletionDialog::get() && CompletionDialog::get()->is_visible()) { |
|
|
|
|
cancel_reparse(); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if(!this->view->has_focus()) |
|
|
|
|
return; |
|
|
|
|
stop(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
view->get_buffer()->signal_mark_set().connect([this](const Gtk::TextIter &iterator, const Glib::RefPtr<Gtk::TextBuffer::Mark> &mark) { |
|
|
|
|
if(mark->get_name() == "insert") |
|
|
|
|
|