Skip to content

Commit

Permalink
Merge branch 'master' into jeremypw/fix-highlight-selection
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremypw authored Feb 8, 2025
2 parents 87ee517 + 46258fa commit 4221965
Show file tree
Hide file tree
Showing 614 changed files with 25,457 additions and 16,226 deletions.
354 changes: 354 additions & 0 deletions data/icons/48/open-project.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/io.elementary.code.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<file alias="scalable/actions/panel-right-symbolic.svg" compressed="true" preprocess="xml-stripblanks">icons/panel-right-symbolic.svg</file>
</gresource>
<gresource prefix="/io/elementary/code/icons">
<file alias="48x48/actions/open-project.svg" compressed="true" preprocess="xml-stripblanks">icons/48/open-project.svg</file>
<file alias="scalable/actions/filter-symbolic.svg" compressed="true" preprocess="xml-stripblanks">icons/filter-symbolic.svg</file>
<file alias="scalable/emblems/emblem-git-modified-symbolic.svg" compressed="true" preprocess="xml-stripblanks">icons/emblem-git-modified-symbolic.svg</file>
<file alias="scalable/emblems/emblem-git-new-symbolic.svg" compressed="true" preprocess="xml-stripblanks">icons/emblem-git-new-symbolic.svg</file>
Expand Down
5 changes: 5 additions & 0 deletions data/io.elementary.code.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@
<summary>Remember the last focused document.</summary>
<description>Restore the focused document from a previous session when opening Code.</description>
</key>
<key name="active-project-path" type="s">
<default>''</default>
<summary>The active project path.</summary>
<description>The path to the folder containing the active project.</description>
</key>
<key name="default-build-directory" type="s">
<default>''</default>
<summary>The default build directory's relative path.</summary>
Expand Down
42 changes: 38 additions & 4 deletions plugins/word-completion/prefix-tree-node.vala
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,50 @@
*/

public class Scratch.Plugins.PrefixNode : Object {
public GLib.List<PrefixNode> children;
public enum NodeType {
ROOT,
CHAR,
WORD_END
}

private const unichar WORD_END_CHAR = '\0';
private uint occurrences; // Only used for WORD_END nodes

public unichar uc { get; construct; }
public NodeType node_type { get; construct; }
public PrefixNode? parent { get; construct; }
public unichar value { get; construct; }

public PrefixNode (unichar c = '\0') {
public Gee.ArrayList<PrefixNode> children;

public PrefixNode.from_unichar (unichar c, PrefixNode? _parent) requires (c != WORD_END_CHAR) {
Object (
value: c
value: c,
parent: _parent,
uc: c,
node_type: NodeType.CHAR
);
}

public PrefixNode.root () {
Object (
parent: null,
uc: WORD_END_CHAR,
node_type: NodeType.ROOT
);
}

public PrefixNode.word_end (PrefixNode _parent) {
Object (
parent: _parent,
uc: WORD_END_CHAR,
node_type: NodeType.WORD_END
);

occurrences = 1;
}

construct {
children = new List<PrefixNode> ();
children = new Gee.ArrayList<PrefixNode> ();
}
}
5 changes: 3 additions & 2 deletions plugins/word-completion/prefix-tree.vala
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ namespace Scratch.Plugins {
}
}

var new_child = new PrefixNode (curr);
node.children.insert_sorted (new_child, (c1, c2) => {
var new_child = new PrefixNode.from_unichar (curr, null);
node.children.insert (0, new_child);
node.children.sort ((c1, c2) => {
if (c1.value > c2.value) {
return 1;
} else if (c1.value == c2.value) {
Expand Down
1 change: 1 addition & 0 deletions po/POTFILES
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ src/Dialogs/GlobalSearchDialog.vala
src/Dialogs/NewBranchDialog.vala
src/Dialogs/PreferencesDialog.vala
src/Dialogs/RestoreConfirmationDialog.vala
src/Dialogs/CloseProjectsConfirmationDialog.vala
src/Dialogs/OverwriteUncommittedConfirmationDialog.vala
src/FolderManager/File.vala
src/FolderManager/FileItem.vala
Expand Down
Loading

0 comments on commit 4221965

Please sign in to comment.