Commit d518aab0 authored by Jørgen Lien Sellæg's avatar Jørgen Lien Sellæg
Browse files

update lambdas to new format

parent 6d40ecd8
Pipeline #188321707 passed with stages
in 16 minutes and 10 seconds
......@@ -31,7 +31,8 @@ Autocomplete::Autocomplete(Gsv::View *view, bool &interactive_completion, guint
return true;
}
return false;
}, false);
},
false);
Please register or sign in to reply
view->signal_focus_out_event().connect([this](GdkEventFocus *event) {
stop();
......
......@@ -678,7 +678,8 @@ void Directories::add_or_update_path(const boost::filesystem::path &dir_path, co
if(directories.find(path_and_row->first.string()) != directories.end())
add_or_update_path(path_and_row->first, path_and_row->second, true);
return false;
}, 500);
},
500);
}
});
......@@ -698,7 +699,8 @@ void Directories::add_or_update_path(const boost::filesystem::path &dir_path, co
if(directories.find(path_and_row->first.string()) != directories.end())
colorize_path(path_and_row->first, false);
return false;
}, 500);
},
500);
}
});
}
......
......@@ -122,7 +122,8 @@ Git::Repository::Repository(const boost::filesystem::path &path) {
if(monitor_event != Gio::FileMonitorEvent::FILE_MONITOR_EVENT_CHANGES_DONE_HINT) {
this->clear_saved_status();
}
}, false);
},
false);
}
Git::Repository::~Repository() {
......
......@@ -29,7 +29,8 @@ void Info::print(const std::string &text) {
timeout_connection = Glib::signal_timeout().connect([this]() {
hide();
return false;
}, timeout);
},
timeout);
label.set_text(text);
show();
......
......@@ -621,7 +621,8 @@ void Notebook::toggle_split() {
Glib::signal_timeout().connect([this] {
set_position(get_width() / 2);
return false;
}, 200);
},
200);
}
else {
for(size_t c = size() - 1; c != static_cast<size_t>(-1); --c) {
......
......@@ -972,10 +972,12 @@ void Project::Clang::recreate_build() {
void Project::Markdown::compile_and_run() {
if(auto view = Notebook::get().get_current_view()) {
auto command = Config::get().project.markdown_command + ' ' + filesystem::escape_argument(filesystem::get_short_path(view->file_path).string());
Terminal::get().async_process(command, "", [command](int exit_status) {
if(exit_status == 127)
Terminal::get().async_print("\e[31mError\e[m: executable not found: " + command + "\n", true);
}, true);
Terminal::get().async_process(
command, "", [command](int exit_status) {
if(exit_status == 127)
Terminal::get().async_print("\e[31mError\e[m: executable not found: " + command + "\n", true);
},
true);
}
}
......
......@@ -47,7 +47,8 @@ SelectionDialogBase::SelectionDialogBase(Gtk::TextView *text_view, const boost::
search_entry.signal_changed().connect([this] {
if(on_search_entry_changed)
on_search_entry_changed(search_entry.get_text());
}, false);
},
false);
list_view_text.set_search_entry(search_entry);
......
......@@ -598,7 +598,8 @@ void Source::View::setup_signals() {
show_diagnostic_tooltips(rectangle);
}
return false;
}, 100);
},
100);
}
if(clickable_tag_applied) {
......@@ -615,7 +616,8 @@ void Source::View::setup_signals() {
apply_clickable_tag(iter);
clickable_tag_applied = true;
return false;
}, 100);
},
100);
}
auto last_mouse_pos = std::make_pair<int, int>(on_motion_last_x, on_motion_last_y);
......@@ -658,14 +660,16 @@ void Source::View::setup_signals() {
show_diagnostic_tooltips(rectangle);
}
return false;
}, 500);
},
500);
delayed_tag_similar_symbols_connection.disconnect();
delayed_tag_similar_symbols_connection = Glib::signal_timeout().connect([this] {
apply_similar_symbol_tag();
similar_symbol_tag_applied = true;
return false;
}, 100);
},
100);
if(SelectionDialog::get())
SelectionDialog::get()->hide();
......
......@@ -358,7 +358,8 @@ void Source::BaseView::monitor_file() {
}
Recursive::f(view);
return false;
}, 1000);
},
1000);
}
};
delayed_monitor_changed_connection.disconnect();
......@@ -376,7 +377,8 @@ void Source::BaseView::monitor_file() {
delayed_monitor_changed_connection = Glib::signal_timeout().connect([this]() {
check_last_write_time();
return false;
}, 1000); // Has to wait 1 second (std::time_t is in seconds)
},
1000); // Has to wait 1 second (std::time_t is in seconds)
}
});
}
......@@ -1339,7 +1341,8 @@ void Source::BaseView::setup_extra_cursor_signals() {
*erase_selection = true;
}
}
}, false);
},
false);
get_buffer()->signal_erase().connect([this, erase_backward_length, erase_forward_length, erase_selection](const Gtk::TextIter & /*iter_start*/, const Gtk::TextIter & /*iter_end*/) {
if(enable_multiple_cursors && (*erase_backward_length != 0 || *erase_forward_length != 0)) {
enable_multiple_cursors = false;
......
......@@ -824,8 +824,10 @@ Source::ClangViewAutocomplete::ClangViewAutocomplete(const boost::filesystem::pa
autocomplete.run();
}
return false;
}, 500);
}, false);
},
500);
},
false);
// Remove argument completions
signal_key_press_event().connect([this](GdkEventKey *event) {
......@@ -838,7 +840,8 @@ Source::ClangViewAutocomplete::ClangViewAutocomplete(const boost::filesystem::pa
CompletionDialog::get()->hide();
}
return false;
}, false);
},
false);
autocomplete.is_restart_key = [this](guint keyval) {
auto iter = get_buffer()->get_insert()->get_iter();
......@@ -2060,7 +2063,8 @@ void Source::ClangView::full_reparse() {
delayed_full_reparse_connection = Glib::signal_timeout().connect([this] {
full_reparse();
return false;
}, 100);
},
100);
return;
}
......
......@@ -144,8 +144,10 @@ void Source::DiffView::configure() {
delayed_buffer_changed_connection = Glib::signal_timeout().connect([this]() {
parse_state = ParseState::starting;
return false;
}, 250);
}, false);
},
250);
},
false);
buffer_erase_connection = get_buffer()->signal_erase().connect([this](const Gtk::TextIter &start_iter, const Gtk::TextIter &end_iter) {
//Do not perform git diff if start_iter and end_iter is at the same line in addition to the line is tagged added
......@@ -157,8 +159,10 @@ void Source::DiffView::configure() {
delayed_buffer_changed_connection = Glib::signal_timeout().connect([this]() {
parse_state = ParseState::starting;
return false;
}, 250);
}, false);
},
250);
},
false);
monitor_changed_connection = repository->monitor->signal_changed().connect([this](const Glib::RefPtr<Gio::File> &file,
const Glib::RefPtr<Gio::File> &,
......@@ -171,7 +175,8 @@ void Source::DiffView::configure() {
LockGuard lock(parse_mutex);
diff = nullptr;
return false;
}, 500);
},
500);
}
});
......
......@@ -130,7 +130,8 @@ void Source::GenericView::setup_buffer_words() {
}
}
}
}, false);
},
false);
// Add all words between start and end of insert
get_buffer()->signal_insert().connect([this](const Gtk::TextIter &iter, const Glib::ustring &text, int bytes) {
......@@ -168,7 +169,8 @@ void Source::GenericView::setup_buffer_words() {
buffer_words.erase(it);
}
}
}, false);
},
false);
// Add new word resulting from erased text
get_buffer()->signal_erase().connect([this](const Gtk::TextIter &start_, const Gtk::TextIter & /*end*/) {
......
......@@ -1404,11 +1404,13 @@ void Source::LanguageProtocolView::setup_signals() {
std::string text = text_;
escape_text(text);
client->write_notification("textDocument/didChange", R"("textDocument":{"uri":")" + this->uri + R"(","version":)" + std::to_string(document_version++) + "},\"contentChanges\":[" + R"({"range":{"start":{"line": )" + std::to_string(start.get_line()) + ",\"character\":" + std::to_string(start.get_line_offset()) + R"(},"end":{"line":)" + std::to_string(start.get_line()) + ",\"character\":" + std::to_string(start.get_line_offset()) + R"(}},"text":")" + text + "\"}" + "]");
}, false);
},
false);
get_buffer()->signal_erase().connect([this](const Gtk::TextIter &start, const Gtk::TextIter &end) {
client->write_notification("textDocument/didChange", R"("textDocument":{"uri":")" + this->uri + R"(","version":)" + std::to_string(document_version++) + "},\"contentChanges\":[" + R"({"range":{"start":{"line": )" + std::to_string(start.get_line()) + ",\"character\":" + std::to_string(start.get_line_offset()) + R"(},"end":{"line":)" + std::to_string(end.get_line()) + ",\"character\":" + std::to_string(end.get_line_offset()) + R"(}},"text":""})" + "]");
}, false);
},
false);
}
else if(capabilities.text_document_sync == LanguageProtocol::Capabilities::TextDocumentSync::full) {
get_buffer()->signal_changed().connect([this]() {
......@@ -1460,8 +1462,10 @@ void Source::LanguageProtocolView::setup_autocomplete() {
autocomplete->run();
}
return false;
}, 500);
}, false);
},
500);
},
false);
// Remove argument completions
signal_key_press_event().connect([this](GdkEventKey *event) {
......@@ -1474,7 +1478,8 @@ void Source::LanguageProtocolView::setup_autocomplete() {
CompletionDialog::get()->hide();
}
return false;
}, false);
},
false);
}
autocomplete->is_restart_key = [this](guint keyval) {
......@@ -1825,7 +1830,8 @@ void Source::LanguageProtocolView::update_type_coverage() {
--update_type_coverage_retries;
update_type_coverage();
return false;
}, 1000);
},
1000);
});
}
return;
......
......@@ -20,7 +20,8 @@ Source::SpellCheckView::SpellCheckView(const boost::filesystem::path &file_path,
}
return false;
}, false);
},
false);
//The following signal is added in case SpellCheckView is not subclassed
signal_key_press_event().connect([this](GdkEventKey *event) {
......@@ -124,7 +125,8 @@ Source::SpellCheckView::SpellCheckView(const boost::filesystem::path &file_path,
get_buffer()->remove_tag(spellcheck_error_tag, begin_no_spellcheck_iter, iter);
}
return false;
}, 1000);
},
1000);
});
// In case of for instance text paste or undo/redo
......@@ -141,7 +143,8 @@ Source::SpellCheckView::SpellCheckView(const boost::filesystem::path &file_path,
get_buffer()->remove_tag(spellcheck_error_tag, word.first, word.second);
}
}
}, false);
},
false);
get_buffer()->signal_mark_set().connect([this](const Gtk::TextIter &iter, const Glib::RefPtr<Gtk::TextBuffer::Mark> &mark) {
if(mark->get_name() == "insert") {
......@@ -178,7 +181,8 @@ Source::SpellCheckView::SpellCheckView(const boost::filesystem::path &file_path,
SelectionDialog::get()->show();
}
return false;
}, 500);
},
500);
}
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment