Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions src/Widgets/SearchBar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -313,19 +313,10 @@ public class Scratch.Widgets.SearchBar : Gtk.Box { //TODO In Gtk4 use a BinLayou

public bool search () {
search_entry.grab_focus ();
if (search_context == null) {
return false;
}

search_context.highlight = false;

if (!has_matches ()) {
debug ("Can't search anything in a non-existent buffer and/or without anything to search.");
if (search_context == null || text_buffer == null || search_entry.text == "") {
return false;
}

search_context.highlight = true;

Gtk.TextIter? start_iter, end_iter;
text_buffer.get_iter_at_offset (out start_iter, text_buffer.cursor_position);

Expand Down
Loading