Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
0e71af8
update dependencies for Gtk4
jeremypw Jun 20, 2026
8b2e18a
Replace Hdy. with Adw.
jeremypw Jun 20, 2026
49f5005
Replace Gtk.SourceFile with Gtk.Source.File
jeremypw Jun 20, 2026
6ca6ef5
Replace Gtk.SourceMap with Gtk.Source.Map
jeremypw Jun 20, 2026
0d45be0
Replace Gtk.SourceBuffer with Gtk.Source.Buffer
jeremypw Jun 20, 2026
2248e41
Replace Gtk.Source with GtkSource.
jeremypw Jun 20, 2026
5399266
Replace draw() with snaphot_line() in GitGutterRenderer
jeremypw Jun 20, 2026
985ec99
Rewrite NavMarkGutterRender query_data
jeremypw Jun 20, 2026
5ac9f85
Temporarily comment out DnD stuff
jeremypw Jun 20, 2026
1d5e383
Replace Gtk.Clipboard with Gdk.Clipboard
jeremypw Jun 20, 2026
f304ce1
Replace GestureMultuPress with GestureClick
jeremypw Jun 22, 2026
d270e41
Merge branch 'jeremypw/gtk4prep/combined' into jeremypw/gtk4
jeremypw Jun 22, 2026
ec4f56a
Replace delete-event with close-request
jeremypw Jun 22, 2026
25eaacc
Replace Granite.Widgets.Welcome with Granite.Placeholder
jeremypw Jun 22, 2026
3e389b4
Replace Granite.Widgets.Toast with Granite.Toast
jeremypw Jun 22, 2026
c7b8ddf
Replace RadioButton with CheckButton
jeremypw Jun 22, 2026
02c8c29
Remove show_all() and no_ahow_all
jeremypw Jun 22, 2026
cddaa03
Remove TemplateManager related code
jeremypw Jun 23, 2026
b5ba66a
Merge branch 'jeremypw/gtk4prep/replace-dialog-run' of https://github…
jeremypw Jun 23, 2026
62755fe
Replace box.add, stack.add, window.add, add_provider_for_display etc
jeremypw Jun 23, 2026
20ca26b
Merge branch 'jeremypw/gtk4prep/lose-template-manager' of https://git…
jeremypw Jun 23, 2026
36206c6
Replace deprecated Gtk style classes with Granite-7 class
jeremypw Jun 23, 2026
ae58313
Replace Gtk.SortColumn
jeremypw Jun 23, 2026
21047ce
Replace Gtk.events_pending ()
jeremypw Jun 23, 2026
aab1c6d
Lose unused entry_path and entry_context
jeremypw Jun 23, 2026
56a6e28
HeaderBar: Replace RadioButton with grouped CheckButton
jeremypw Jun 23, 2026
bdf5551
Replace Gtk.ModelButton with Gtk.Button in HeaderBar
jeremypw Jun 23, 2026
7b6f8cb
Replace show_uri_on_window with UriLauncher
jeremypw Jun 23, 2026
fe809e6
Missed bits
jeremypw Jun 23, 2026
39f7ab0
Replace margin property with margin_top etc
jeremypw Jun 23, 2026
649fb49
Merge branch 'jeremypw/gtk4prep/margin' of https://github.com/element…
jeremypw Jun 23, 2026
801e02e
Fix typos
jeremypw Jun 23, 2026
96b946e
Merge branch 'jeremypw/gtk4prep/margin' of https://github.com/element…
jeremypw Jun 23, 2026
68fa12f
Replace or omit Gtk.IconSize
jeremypw Jun 23, 2026
c1104ad
Replace get_toplevel () with get_root ()
jeremypw Jun 23, 2026
546c815
Use scroll controller in Document View to trigger zoom action
jeremypw Jun 23, 2026
bbdc4ac
Merge branch 'jeremypw/gtk4prep/combined' of https://github.com/eleme…
jeremypw Jun 23, 2026
5d6ba6f
Merge branch 'jeremypw/gtk4prep/scrollcontroller-zoom' of https://git…
jeremypw Jun 23, 2026
7289d63
Port scroll controller in Document
jeremypw Jun 23, 2026
03eccdf
Merge branch 'jeremypw/gtk4prep/combined' of https://github.com/eleme…
jeremypw Jun 24, 2026
9f9c961
Replace focus-out-event handler in Document.vala (Gtk3)
jeremypw Jun 24, 2026
120b2ba
Replace enter-notify-event with EventFocusController
jeremypw Jun 24, 2026
4a854f0
Lose focus-in-event handler in DocumentView
jeremypw Jun 24, 2026
d4306d8
Merge branch 'jeremypw/gtk4prep/combined' of https://github.com/eleme…
jeremypw Jun 24, 2026
e145630
Replace enter_notify_event handler in Terminal
jeremypw Jun 24, 2026
8822d3e
Merge branch 'jeremypw/gtk4prep/combined' of https://github.com/eleme…
jeremypw Jun 24, 2026
382dc9a
Replace WindowState with ToplevelState
jeremypw Jun 24, 2026
d7f8022
Replace checkbutton.clicked with checkbutton.toggled
jeremypw Jun 24, 2026
a49a36c
Merge branch 'jeremypw/gtk4prep/combined' of https://github.com/eleme…
jeremypw Jun 24, 2026
222dc98
Merge branch 'jeremypw/gtk4prep/combined' into jeremypw/gtk4
jeremypw Jun 25, 2026
41e419b
Fix merge
jeremypw Jun 25, 2026
b7ec630
Replace Paned pack1 and pack2
jeremypw Jun 25, 2026
6e254f7
Delete Gtk3 specific comment in SourceList
jeremypw Jun 25, 2026
b0b4363
Replace get_children ()
jeremypw Jun 25, 2026
9eaec09
Fix construction of eventcontroller and add_controller
jeremypw Jun 25, 2026
101de63
Use filechooser.get_files () and iterate ListModel
jeremypw Jun 25, 2026
94bc230
Fix ProjectCHooserButton
jeremypw Jun 25, 2026
7a38345
User button controller instead of button event in Project Button
jeremypw Jun 26, 2026
68def28
Merge branch 'jeremypw/gtk4prep/combined' into jeremypw/gtk4
jeremypw Jun 26, 2026
fbe2fa2
Lose get_action_group, fix activate_action syntax
jeremypw Jun 26, 2026
c62e772
Replace begin/end undoableaction
jeremypw Jun 26, 2026
1c6f1b3
Merge branch 'jeremypw/gtk4prep/combined' of https://github.com/eleme…
jeremypw Jun 26, 2026
5d30baa
Fix homogeneous
jeremypw Jun 26, 2026
b324920
Fix invalid properties/members
jeremypw Jun 26, 2026
cad9eb9
Various syntax property and member fixes
jeremypw Jun 26, 2026
de81207
Fix more syntax. members. functions
jeremypw Jun 26, 2026
bb275c0
Fix more syntax etc
jeremypw Jun 26, 2026
3a34c7a
Fix typo
jeremypw Jun 28, 2026
ba47d33
add_class -> add_css_class
jeremypw Jun 28, 2026
071471a
Replace remove_class with remove_css_class
jeremypw Jun 28, 2026
6c4adec
Replace add_provider with add_provider_for_display
jeremypw Jun 28, 2026
bbf2e34
more add_class -> add_css_class
jeremypw Jun 28, 2026
fedef5f
cssprovider load_from_data -> load_from_string
jeremypw Jun 28, 2026
17bd55e
Fix get_tooltip_context syntax
jeremypw Jun 28, 2026
7ff4018
Avoid Window.get_size ()
jeremypw Jun 28, 2026
b90568a
Merge branch 'jeremypw/gtk4prep/combined' of https://github.com/eleme…
jeremypw Jun 28, 2026
5b11b72
Merge branch 'jeremypw/gtk4prep/combined' into jeremypw/gtk4
jeremypw Jul 3, 2026
93bd38e
Reinstate action undo and redo
jeremypw Jul 3, 2026
b5cfc4d
Fix FileCHooserNative syntax
jeremypw Jul 3, 2026
d232f12
Lose undo/redo MainWindow actions
jeremypw Jul 3, 2026
efae8a4
Lose get_size
jeremypw Jul 3, 2026
55c2bcb
Fix clipboard syntax
jeremypw Jul 3, 2026
c63e9a8
Fix search entry syntax
jeremypw Jul 3, 2026
55884c1
Fix notify["is-focus"]
jeremypw Jul 3, 2026
cbc3644
typos
jeremypw Jul 3, 2026
930e887
Lose no longer existent unnecessary properties
jeremypw Jul 3, 2026
85ac021
Replace AlertView with Placeholder
jeremypw Jul 3, 2026
8015271
Fix StyleContext syntax; get_margin, padding, border
jeremypw Jul 6, 2026
90324ce
Fix syntax for new ScrolledWindow
jeremypw Jul 6, 2026
b38bf9f
Fix new Gtk.Popover syntax
jeremypw Jul 6, 2026
51ca638
Fix appendbutton syntax in Granite.Placeholder
jeremypw Jul 6, 2026
4844f26
Replace add with child= in ScrolledWindow; expand -> vexpand, hexpand
jeremypw Jul 6, 2026
3b9d4a0
Fix Gtk.Popover construction
jeremypw Jul 6, 2026
c502160
Fix GtkSource.GutterLines get_first () returns uint
jeremypw Jul 6, 2026
7396339
Fix Granite.HeaderLabel no longer Gtk.Label
jeremypw Jul 6, 2026
04c777d
More FileChooser syntax changes
jeremypw Jul 6, 2026
ba38882
Use Graphene.Rect instead of Gdk
jeremypw Jul 6, 2026
372ba5b
Update TreeView row_activated signature
jeremypw Jul 6, 2026
75bba14
Remove absent Widget.popup_menu () signal
jeremypw Jul 6, 2026
07fc378
Fix GutterRenderer activate signature
jeremypw Jul 6, 2026
6ea0c28
Fix GutterRenderer query_activatable signature
jeremypw Jul 6, 2026
0d64e8b
Replace render with snapshot in CellRendererBadge
jeremypw Jul 6, 2026
378c056
Lose CellRendererExpander
jeremypw Jul 6, 2026
936a0d4
Rename function
jeremypw Jul 6, 2026
1e17dcd
Lose unused render function
jeremypw Jul 6, 2026
637f145
activated -> clicked in WelcomeView
jeremypw Jul 6, 2026
68e61f1
Fix missing connect
jeremypw Jul 6, 2026
7148434
Document.vala small errors
jeremypw Jul 6, 2026
3212281
DocumentView add missing constant
jeremypw Jul 6, 2026
9df40c3
Use Gtk.HeaderBar and do not subclass
jeremypw Jul 6, 2026
c4893ec
Adjust MainWindow for new headerbar
jeremypw Jul 6, 2026
912c9d7
Various small errors
jeremypw Jul 6, 2026
ad60add
FormatBar small errors
jeremypw Jul 6, 2026
2cc5421
PopoverMenuItem fix accessible role syntax
jeremypw Jul 6, 2026
e73173c
Fix Gtk.PopoverMenu syntax in SourceList
jeremypw Jul 7, 2026
d86e0de
Document: Fix unhandled error
jeremypw Jul 7, 2026
6c4549a
Fix various small errors
jeremypw Jul 7, 2026
4c5a92c
Fix another unhandled error
jeremypw Jul 7, 2026
6bf70b0
Update codecore.deps
jeremypw Jul 7, 2026
483f444
Do not subclass ScrolledWindow in SourceList
jeremypw Jul 7, 2026
ffc8cd7
Do not subclass MenuButton
jeremypw Jul 7, 2026
899f4d2
Do not subclass CellRendererPixbuf
jeremypw Jul 7, 2026
44f6901
Fix syntax in pastebin plugin
jeremypw Jul 7, 2026
c556685
Fix small errors in vim-emulation
jeremypw Jul 7, 2026
6e4a042
Fix errors in brackets-completion
jeremypw Jul 7, 2026
f85be7c
Fix errors in markdown actions
jeremypw Jul 7, 2026
865967a
Rewrite completion provider for GtkSource
jeremypw Jul 8, 2026
cecfaa5
Fix small errors in fuzzy search
jeremypw Jul 8, 2026
0d8e51f
Address initial run-time errors
jeremypw Jul 8, 2026
a4126f7
Commit partial migration SourceList -> TreeList
jeremypw Jul 10, 2026
fcc90bb
Use string for badge in TreeListItem
jeremypw Jul 10, 2026
b589455
Compilable TreeList
jeremypw Jul 10, 2026
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
14 changes: 7 additions & 7 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ project(
'io.elementary.code',
'vala', 'c',
meson_version: '>= 0.58.0',
version: '8.3.1'
version: '9.0.0'
)

add_project_arguments([
Expand All @@ -29,16 +29,16 @@ i18n = import('i18n')
glib_dep = dependency('glib-2.0', version: '>=2.74.0')
gio_unix_dep = dependency('gio-unix-2.0', version: '>=2.20')
gee_dep = dependency('gee-0.8', version: '>=0.8.5')
gtk_dep = dependency('gtk+-3.0', version: '>=3.6.0')
granite_dep = dependency('granite', version: '>=6.0.0')
handy_dep = dependency('libhandy-1', version: '>=0.90.0')
gtksourceview_dep = dependency('gtksourceview-4')
gtk_dep = dependency('gtk4', version: '>=4.14.2')
granite_dep = dependency('granite-7', version: '>=7.0.0')
adwaita_dep = dependency('libadwaita-1', version: '>=1.0.0')
gtksourceview_dep = dependency('gtksourceview-5')
peas_dep = dependency('libpeas-2')
git_dep = dependency('libgit2-glib-1.0', version: '>=1.2.0')
fontconfig_dep = dependency('fontconfig')
pangofc_dep = dependency('pangoft2')
posix_dep = meson.get_compiler('vala').find_library('posix')
vte_dep = dependency('vte-2.91')
vte_dep = dependency('vte-2.91-gtk4', version: '>=0.76')

code_resources = gnome.compile_resources(
'code-resources', 'data/' + meson.project_name() + '.gresource.xml',
Expand All @@ -55,7 +55,7 @@ dependencies = [
gee_dep,
gtk_dep,
granite_dep,
handy_dep,
adwaita_dep,
gtksourceview_dep,
peas_dep,
git_dep,
Expand Down
41 changes: 24 additions & 17 deletions plugins/brackets-completion/brackets-completion.vala
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ public class Scratch.Plugins.BracketsCompletion : Peas.ExtensionBase, Scratch.Se
plugins = (Scratch.Services.Interface) object;
plugins.hook_document.connect (on_hook_document);
plugins.hook_window.connect ((w) => {
key_controller = new Gtk.EventControllerKey (w) {
key_controller = new Gtk.EventControllerKey () {
propagation_phase = CAPTURE
};
((Gtk.Widget) w).add_controller (key_controller);
key_controller.key_pressed.connect (on_key_down);
key_controller.key_released.connect (on_key_release);
});
}

Expand All @@ -57,15 +59,17 @@ public class Scratch.Plugins.BracketsCompletion : Peas.ExtensionBase, Scratch.Se

private void on_hook_document (Scratch.Services.Document doc) {
current_buffer = doc.source_view.buffer;

// var key_controller = new Gtk.EventControllerKey () {
// propagation_phase = BUBBLE
// };
if (current_source_view != null) {
current_source_view.event_after.disconnect (on_event_after);
// current_source_view.event_after.disconnect (on_event_after);
current_source_view.backspace.disconnect (on_backspace);
}

current_source_view = doc.source_view;

current_source_view.event_after.connect (on_event_after);
// current_source_view.event_after.connect (on_event_after);
current_source_view.backspace.connect (on_backspace);
}

Expand Down Expand Up @@ -174,11 +178,11 @@ public class Scratch.Plugins.BracketsCompletion : Peas.ExtensionBase, Scratch.Se
Gdk.ModifierType state
) requires (current_source_view != null && current_buffer != null) {

if (!current_source_view.is_focus) {
if (!current_source_view.is_focus ()) {
return false;
}

if (Gdk.ModifierType.MOD1_MASK in state || Gdk.ModifierType.CONTROL_MASK in state) {
if (Gdk.ModifierType.ALT_MASK in state || Gdk.ModifierType.CONTROL_MASK in state) {
return false;
}

Expand Down Expand Up @@ -235,22 +239,25 @@ public class Scratch.Plugins.BracketsCompletion : Peas.ExtensionBase, Scratch.Se
}
}

private void on_event_after (Gdk.Event root_event) {
if (root_event.type != Gdk.EventType.KEY_PRESS) {
return;
}

var event = root_event.key;
private void on_key_release (
uint keyval,
uint keycode,
Gdk.ModifierType state
) {
// private void on_event_after (Gdk.Event root_event) {
// if (root_event.type != Gdk.EventType.KEY_PRESS) {
// return;
// }

if (current_source_view.auto_indent && (event.keyval == Gdk.Key.Return || event.keyval == Gdk.Key.KP_Enter)) {
if (current_source_view.auto_indent && (keyval == Gdk.Key.Return || keyval == Gdk.Key.KP_Enter)) {
check_bracket_indent ();
}

if (keys.has_key (event.keyval) &&
!(Gdk.ModifierType.MOD1_MASK in event.state) &&
!(Gdk.ModifierType.CONTROL_MASK in event.state)) {
if (keys.has_key (keyval) &&
!(Gdk.ModifierType.ALT_MASK in state) &&
!(Gdk.ModifierType.CONTROL_MASK in state)) {

string bracket = keys[event.keyval];
string bracket = keys[keyval];
string next_char = get_next_char ();
string prev_char = get_previous_char ();
bool brackets_match = next_char == bracket && prev_char == bracket;
Expand Down
2 changes: 1 addition & 1 deletion plugins/detect-indent/detect-indent.vala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class Scratch.Plugins.DetectIndent: Peas.ExtensionBase, Scratch.Services.
return;
}

var source_buffer = (Gtk.SourceBuffer) view.buffer;
var source_buffer = (GtkSource.Buffer) view.buffer;
Gtk.TextIter it;
source_buffer.get_iter_at_line (out it, 0);

Expand Down
18 changes: 10 additions & 8 deletions plugins/fuzzy-search/file-item.vala
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public class FileItem : Gtk.ListBoxRow {
}

public FileItem (SearchResult res, bool should_distinguish_project = false) {
this.get_style_context ().add_class ("fuzzy-item");
this.get_style_context ().add_class ("flat");
this.add_css_class ("fuzzy-item");
this.add_css_class ("flat");

result = res;
Icon icon;
Expand All @@ -41,18 +41,20 @@ public class FileItem : Gtk.ListBoxRow {
icon = ContentType.get_icon ("text/plain");
}

var image = new Gtk.Image.from_gicon (icon, Gtk.IconSize.DND);
image.get_style_context ().add_class ("fuzzy-file-icon");
var image = new Gtk.Image.from_gicon (icon) {
icon_size = Gtk.IconSize.NORMAL
};
image.add_css_class ("fuzzy-file-icon");

path_box.add (filename_label);
path_box.add (path_label);
path_box.append (filename_label);
path_box.append (path_label);

var container_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 1) {
valign = Gtk.Align.CENTER
};

container_box.add (image);
container_box.add (path_box);
container_box.append (image);
container_box.append (path_box);

this.child = container_box;
}
Expand Down
63 changes: 29 additions & 34 deletions plugins/fuzzy-search/fuzzy-search-popover.vala
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
public class Scratch.FuzzySearchPopover : Gtk.Popover {
private Gtk.SearchEntry search_term_entry;
private Services.FuzzyFinder fuzzy_finder;
private Gtk.ListBox search_result_container;
private Gtk.ListBox search_result_listbox;
private int preselected_index;
private Gtk.ScrolledWindow scrolled;
private Gee.ArrayList<FileItem> items;
private Scratch.Services.FuzzySearchIndexer indexer;
private int window_height;
private int max_items;
private Gee.LinkedList<GLib.Cancellable> cancellables;
private Gtk.EventControllerKey search_term_entry_key_controller;
// private Gtk.EventControllerKey search_term_entry_key_controller;
private Gtk.Label title_label;
private string current_doc_project;
public Scratch.MainWindow current_window { get; construct; }
Expand Down Expand Up @@ -63,30 +63,28 @@ public class Scratch.FuzzySearchPopover : Gtk.Popover {
}

construct {
modal = true;
relative_to = current_window.document_view;
width_request = 500;
pointing_to = { 0, 32, 1, 1 };

this.get_style_context ().add_class ("fuzzy-popover");
this.add_css_class ("fuzzy-popover");

title_label = new Gtk.Label (_("Find project files"));
title_label.halign = Gtk.Align.START;
title_label.get_style_context ().add_class ("h4");
title_label.add_css_class ("h4");

search_term_entry = new Gtk.SearchEntry ();
search_term_entry.halign = Gtk.Align.FILL;
search_term_entry.hexpand = true;

search_result_container = new Gtk.ListBox () {
search_result_listbox = new Gtk.ListBox () {
selection_mode = Gtk.SelectionMode.NONE,
activate_on_single_click = true,
can_focus = false
};

search_result_container.get_style_context ().add_class ("fuzzy-list");
search_result_listbox.add_css_class ("fuzzy-list");

search_result_container.row_activated.connect ((row) => {
search_result_listbox.row_activated.connect ((row) => {
var file_item = row as FileItem;
if (file_item == null) {
return;
Expand All @@ -95,7 +93,8 @@ public class Scratch.FuzzySearchPopover : Gtk.Popover {
handle_item_selection (items.index_of (file_item));
});

search_term_entry_key_controller = new Gtk.EventControllerKey (search_term_entry);
var search_term_entry_key_controller = new Gtk.EventControllerKey ();
search_term_entry.add_controller (search_term_entry_key_controller);
search_term_entry_key_controller.key_pressed.connect ((keyval, keycode, state) => {
// Handle key up/down to select other files found by fuzzy search
switch (keyval) {
Expand Down Expand Up @@ -184,10 +183,9 @@ public class Scratch.FuzzySearchPopover : Gtk.Popover {

bool first = true;



foreach (var c in search_result_container.get_children ()) {
search_result_container.remove (c);
var child = search_result_listbox.get_first_child ();
while (child != null) {
search_result_listbox.remove (child);
}

items.clear ();
Expand All @@ -198,16 +196,15 @@ public class Scratch.FuzzySearchPopover : Gtk.Popover {

if (first) {
first = false;
file_item.get_style_context ().add_class ("preselect-fuzzy");
file_item.add_css_class ("preselect-fuzzy");
preselected_index = 0;
}

search_result_container.add (file_item);
search_result_listbox.append (file_item);
items.add (file_item);
}

scrolled.hide ();
scrolled.show_all ();

// Reset scrolling
scrolled.vadjustment.value = 0;
Expand All @@ -216,8 +213,9 @@ public class Scratch.FuzzySearchPopover : Gtk.Popover {
return Source.REMOVE;
});
} else {
foreach (var c in search_result_container.get_children ()) {
search_result_container.remove (c);
var child = search_result_listbox.get_first_child ();
while (child != null) {
search_result_listbox.remove (child);
}

items.clear ();
Expand All @@ -228,33 +226,30 @@ public class Scratch.FuzzySearchPopover : Gtk.Popover {
var entry_layout = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
entry_layout.valign = Gtk.Align.START;

entry_layout.add (title_label);
entry_layout.add (search_term_entry);
entry_layout.append (title_label);
entry_layout.append (search_term_entry);
search_term_entry.valign = Gtk.Align.START;

scrolled = new Gtk.ScrolledWindow (null, null) {
scrolled = new Gtk.ScrolledWindow () {
propagate_natural_height = true,
hexpand = true
hexpand = true,
child = search_result_listbox
};

scrolled.add (search_result_container);

var box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
box.pack_start (entry_layout, false, false);
box.pack_end (scrolled, true, true);
box.show_all ();
box.prepend (entry_layout);
box.append (scrolled);

scrolled.hide ();
this.add (box);
this.child = box;

fuzzy_finder = new Services.FuzzyFinder (search_indexer.project_paths);
indexer = search_indexer;
items = new Gee.ArrayList<FileItem> ();
cancellables = new Gee.LinkedList<GLib.Cancellable> ();

search_term_entry.realize.connect_after (() => {
int height;
current_window.get_size (null, out height);
int height = current_window.get_size (VERTICAL);

// Limit the shown results if the window height is too small
if (height > 400) {
Expand All @@ -266,7 +261,7 @@ public class Scratch.FuzzySearchPopover : Gtk.Popover {
scrolled.set_max_content_height (45 /* height */ * max_items);

current_doc_project = get_current_project (); // This will not change while popover is showing
search_result_container.set_sort_func ((a , b) => {
search_result_listbox.set_sort_func ((a , b) => {
var result_a = ((FileItem)a).result;
var result_b = ((FileItem)b).result;
var project_a_is_current = result_a.project == current_doc_project;
Expand All @@ -293,8 +288,8 @@ public class Scratch.FuzzySearchPopover : Gtk.Popover {

private void preselect_new_item (FileItem old_item, FileItem new_item) {
var class_name = "preselect-fuzzy";
old_item.get_style_context ().remove_class (class_name);
new_item.get_style_context ().add_class (class_name);
old_item.remove_css_class (class_name);
new_item.add_css_class (class_name);
}

private string get_current_project () {
Expand Down
1 change: 0 additions & 1 deletion plugins/fuzzy-search/fuzzy-search.vala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
public class Scratch.Plugins.FuzzySearch: Peas.ExtensionBase, Scratch.Services.ActivatablePlugin {
public Object object { owned get; set construct; }
private const uint ACCEL_KEY = Gdk.Key.F;
private const Gdk.ModifierType ACCEL_MODTYPE = Gdk.ModifierType.MOD1_MASK;

private Scratch.Services.FuzzySearchIndexer indexer;
private MainWindow window = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
public class Scratch.Plugins.HighlightSelectedWords : Peas.ExtensionBase, Scratch.Services.ActivatablePlugin {
Scratch.Widgets.SourceView current_source;
Scratch.MainWindow? main_window = null;
Gtk.SourceSearchContext? current_search_context = null;
GtkSource.SearchContext? current_search_context = null;

private const uint SELECTION_HIGHLIGHT_MAX_CHARS = 255;

Expand Down Expand Up @@ -118,8 +118,8 @@ public class Scratch.Plugins.HighlightSelectedWords : Peas.ExtensionBase, Scratc

// We know the selected text is non-zero length, check not too long
if (selected_text.char_count () <= SELECTION_HIGHLIGHT_MAX_CHARS) {
current_search_context = new Gtk.SourceSearchContext (
(Gtk.SourceBuffer)current_source.buffer,
current_search_context = new GtkSource.SearchContext (
(GtkSource.Buffer)current_source.buffer,
null
);
current_search_context.settings.search_text = selected_text;
Expand Down
Loading
Loading