Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix highlighting after reselection of same word #1484

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
8a902a9
Increase maximum selection length
Oct 7, 2024
eb3db43
Merge branch 'master' into jeremypw/fix-highlight-selection
zeebok Oct 9, 2024
5ad6921
Add "active-project-path" setting.
Oct 9, 2024
4eb0372
Dont change active project just because a document changes
Oct 9, 2024
67f238c
Remove some unused code relating to active_project
Oct 9, 2024
a3c10fa
Merge branch 'master' into jeremypw/fix-highlight-selection
zeebok Oct 10, 2024
c2f4940
Merge branch 'master' into jeremypw/sync-activeproject-startup
jeremypw Oct 13, 2024
c05ab29
Do not override active project with default on startup
Oct 13, 2024
5b4db0e
Show global search dialog if scope unspecified
Oct 13, 2024
ad9cc13
Distinguish global search path from default action target
Oct 14, 2024
916e10d
Allow global search when no active project
Oct 14, 2024
ca34ddd
Set active project after load folder is none already set
Oct 14, 2024
baf705e
FileView: Use git_manager property
Oct 14, 2024
b32acf1
Merge branch 'master' into jeremypw/fix-highlight-selection
zeebok Oct 20, 2024
43a4e4d
Merge branch 'master' into jeremypw/fix-highlight-selection
zeebok Oct 22, 2024
9fb47a0
Merge branch 'master' into jeremypw/fix-highlight-selection
zeebok Oct 22, 2024
b6485f4
Merge branch 'master' into jeremypw/fix-highlight-selection
jeremypw Oct 22, 2024
f742237
Simplify, handle mark-deleted signal
Oct 22, 2024
19cca3d
Update spaces immediately
Oct 22, 2024
5d350e7
Merge branch 'master' into jeremypw/sync-activeproject-startup
jeremypw Oct 30, 2024
43c1023
Allow no project to be restored. Only user sets active project.
Oct 30, 2024
0bca777
Merge branch 'master' into jeremypw/sync-activeproject-startup
jeremypw Nov 6, 2024
58f45bd
Merge branch 'master' into jeremypw/fix-highlight-selection
jeremypw Nov 28, 2024
0b00d39
Merge branch 'master' into jeremypw/rework-highlight-selection
zeebok Dec 1, 2024
3794a65
Merge branch 'master' into jeremypw/sync-activeproject-startup
zeebok Dec 1, 2024
e49889c
Merge branch 'master' into jeremypw/rework-highlight-selection
jeremypw Dec 2, 2024
9f129cf
Separate throttle for selection change
Dec 2, 2024
24da045
Merge branch 'master' into jeremypw/sync-activeproject-startup
jeremypw Dec 7, 2024
f01dfde
On close other folders make remaining active
Dec 7, 2024
48320f3
Set active project context menu item for git repos
Dec 7, 2024
0198f70
Merge branch 'master' into jeremypw/fix-highlight-selection
jeremypw Dec 12, 2024
62a8244
Merge branch 'master' into jeremypw/rework-highlight-selection
jeremypw Jan 8, 2025
2fa14e9
Merge branch 'master' into jeremypw/sync-activeproject-startup
jeremypw Jan 8, 2025
1882a3e
Change install and run under different name
Jan 11, 2025
c0d8733
Merge branch 'master' into jeremypw/fix-highlight-selection
jeremypw Jan 11, 2025
6c9afb9
Merge pull request #1 from elementary/jeremypw/fix-highlight-selection
jeremypw Jan 11, 2025
d8e21e4
Merge branch 'master' into jeremypw/sync-activeproject-startup
jeremypw Jan 11, 2025
e46440b
Merge pull request #2 from elementary/jeremypw/sync-activeproject-sta…
jeremypw Jan 11, 2025
bef4a0a
Merge branch 'master' into jeremypw/rework-highlight-selection
jeremypw Jan 11, 2025
2a7161d
Merge branch 'master' into jeremypw/rework-highlight-selection
zeebok Jan 12, 2025
72bb50c
Fix schema paths
Jan 12, 2025
adba6ec
Merge branch 'master' into jeremypw/rework-highlight-selection
jeremypw Jan 12, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: code.flatpak
manifest-path: io.elementary.code.yml
manifest-path: com.github.jeremypw.dogfood-code-7.yml
repository-name: appcenter
repository-url: https://flatpak.elementary.io/repo.flatpakrepo
cache-key: "flatpak-builder-${{ github.sha }}"
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Code
[![Translation status](https://l10n.elementary.io/widgets/code/-/svg-badge.svg)](https://l10n.elementary.io/projects/code/?utm_source=widget)

# Dogfood-code-7
![Screenshot](data/screenshot.png?raw=true)

## Building, Testing, and Installation
Expand All @@ -27,7 +25,7 @@ Run `meson build` to configure the build environment. Change to the build direct
cd build
ninja test

To install, use `ninja install`, then execute with `io.elementary.code`
To install, use `ninja install`, then execute with `com.github.jeremypw.dogfood-code-7`

sudo ninja install
io.elementary.code
com.github.jeremypw.dogfood-code-7
2 changes: 1 addition & 1 deletion data/code.policy.in.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<vendor>elementary</vendor>
<vendor_url>https://github.com/elementary/code</vendor_url>
<icon_name>io.elementary.code</icon_name>
<action id="org.freedesktop.policykit.pkexec.io.elementary.code">
<action id="org.freedesktop.policykit.pkexec.com.github.jeremypw.dogfood-code-7">
<description>Run Code as Administrator</description>
<message>Authentication is required to run Code as Administrator</message>
<defaults>
Expand Down
6 changes: 3 additions & 3 deletions data/io.elementary.code.desktop.in.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[Desktop Entry]
Type=Application
Name=@NAME@
Comment=Edit code files
GenericName=Code Editor
Comment=Dogfood Code editor on eOS7
GenericName=Experimental Code Editor
Exec=@EXEC_NAME@ %U
Icon=io.elementary.code
Icon=missing-image
Terminal=false
Categories=Development;GTK;IDE;WebDevelopment;
Keywords=text;IDE;scratch;code;
Expand Down
25 changes: 15 additions & 10 deletions data/io.elementary.code.gschema.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
<enum id="io.elementary.code.window-states">
<enum id="com.github.jeremypw.dogfood-code-7.window-states">
<value nick="Normal" value="0" />
<value nick="Maximized" value="1" />
<value nick="Fullscreen" value="2" />
</enum>
<enum id="io.elementary.code.draw-spaces-states">
<enum id="com.github.jeremypw.dogfood-code-7.draw-spaces-states">
<value nick="Never" value="0" />
<value nick="For Selection" value="1" />
<value nick="Always" value="2" />
<value nick="Current" value="4" />
</enum>
<enum id="io.elementary.code.case-sensitive-mode">
<enum id="com.github.jeremypw.dogfood-code-7.case-sensitive-mode">
<value nick="never" value="0" />
<value nick="mixed" value="1" />
<value nick="always" value="2" />
</enum>

<schema path="/io/elementary/code/saved-state/" id="io.elementary.code.saved-state" gettext-domain="io.elementary.code">
<key name="window-state" enum="io.elementary.code.window-states">
<schema path="/com/github/jeremypw/dogfood-code-7/saved-state/" id="com.github.jeremypw.dogfood-code-7.saved-state" gettext-domain="com.github.jeremypw.dogfood-code-7">
<key name="window-state" enum="com.github.jeremypw.dogfood-code-7.window-states">
<default>"Normal"</default>
<summary>The saved state of the window.</summary>
<description>The saved state of the window.</description>
Expand Down Expand Up @@ -65,7 +65,7 @@
</key>
</schema>

<schema path="/io/elementary/code/settings/" id="io.elementary.code.settings" gettext-domain="io.elementary.code">
<schema path="/com/github/jeremypw/dogfood-code-7/" id="com.github.jeremypw.dogfood-code-7.settings" gettext-domain="com.github.jeremypw.dogfood-code-7">
<key type="as" name="plugins-enabled">
<default>['brackets-completion', 'detect-indent', 'editorconfig']</default>
<summary>Enabled Plugins</summary>
Expand Down Expand Up @@ -106,7 +106,7 @@
<summary>Highlight Matching Brackets</summary>
<description>Whether Code should highlight matching brackets.</description>
</key>
<key name="draw-spaces" enum="io.elementary.code.draw-spaces-states">
<key name="draw-spaces" enum="com.github.jeremypw.dogfood-code-7.draw-spaces-states">
<default>"For Selection"</default>
<summary>Draw spaces and tabs with symbols</summary>
<description>Draw spaces and tabs with symbols. "Never" is deprecated and not exposed in the UI.</description>
Expand Down 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 Expand Up @@ -182,7 +187,7 @@
<summary>Whether search term is a regex expression</summary>
<description>Whether the search should use the search term as a regex expression for matching.</description>
</key>
<key name="case-sensitive-search" enum="io.elementary.code.case-sensitive-mode">
<key name="case-sensitive-search" enum="com.github.jeremypw.dogfood-code-7.case-sensitive-mode">
<default>'mixed'</default>
<summary>When text search is case sensitive</summary>
<description>Whether the text search is case sensitive never, always or only when search term is mixed case</description>
Expand All @@ -194,7 +199,7 @@
</key>
</schema>

<schema path="/io/elementary/code/services/" id="io.elementary.code.services" gettext-domain="io.elementary.code">
<schema path="/com/github/jeremypw/dogfood-code-7/services/" id="com.github.jeremypw.dogfood-code-7.services" gettext-domain="com.github.jeremypw.dogfood-code-7">
<key name="paste-format-code" type="s">
<default>'None'</default>
<summary>Default PasteBin text highlight</summary>
Expand All @@ -212,7 +217,7 @@
</key>
</schema>

<schema path="/io/elementary/code/folder-manager/" id="io.elementary.code.folder-manager">
<schema path="/com/github/jeremypw/dogfood-code-7/folder-manager/" id="com.github.jeremypw.dogfood-code-7.folder-manager">
<key name="opened-folders" type="as">
<default>[]</default>
<summary>Opened folders.</summary>
Expand Down
2 changes: 1 addition & 1 deletion data/io.elementary.code.plugins.spell.gschema.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
<schema path="/io/elementary/code/plugins/spell/" id="io.elementary.code.plugins.spell">
<schema path="/com/github/jeremypw/dogfood-code-7/plugins/spell/" id="com.github.jeremypw.dogfood-code-7.plugins.spell">
<key name="language" type="s">
<default>'en_US'</default>
<summary>Selected Spellcheck Language</summary>
Expand Down
22 changes: 11 additions & 11 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ foreach i : icon_sizes
install_data(
'icons' / i + '.svg',
install_dir: get_option('datadir') / 'icons' / 'hicolor' / i + 'x' + i / 'apps',
rename: meson.project_name() + '.svg'
rename: install_name + '.svg'
)
install_data(
'icons' / i + '.svg',
install_dir: get_option('datadir') / 'icons' / 'hicolor' / i + 'x' + i + '@2' / 'apps',
rename: meson.project_name() + '.svg'
rename: install_name + '.svg'
)
endforeach

Expand All @@ -20,7 +20,7 @@ install_data([

install_data([
'fonts/BuilderBlocks.ttf',
], install_dir: get_option('datadir') / meson.project_name() / 'fonts')
], install_dir: get_option('datadir') / install_name / 'fonts')

install_data(
'io.elementary.code.gschema.xml',
Expand All @@ -29,12 +29,12 @@ install_data(
)

config_data = configuration_data()
config_data.set('EXEC_NAME', meson.project_name())
config_data.set('EXEC_NAME', install_name)

if (branch != '')
config_data.set('NAME', 'Code - ' + branch)
config_data.set('NAME', 'Dogfood Code 7 - ' + branch)
else
config_data.set('NAME', 'Code')
config_data.set('NAME', 'Dogfood Code 7')
endif

# Set the executable name and translate the desktop files
Expand All @@ -46,7 +46,7 @@ desktop_in_file = configure_file(

desktop_file = i18n.merge_file(
input: desktop_in_file,
output: 'io.elementary.code.desktop',
output: install_name + '.desktop',
po_dir: meson.project_source_root () / 'po' / 'extra',
type: 'desktop',
install_dir: get_option('datadir') / 'applications',
Expand All @@ -55,7 +55,7 @@ desktop_file = i18n.merge_file(

i18n.merge_file(
input: 'code.metainfo.xml.in',
output: meson.project_name() + '.metainfo.xml',
output: install_name + '.metainfo.xml',
po_dir: meson.project_source_root() / 'po' / 'extra',
type: 'xml',
install: true,
Expand All @@ -65,19 +65,19 @@ i18n.merge_file(
config_data = configuration_data()
config_data.set('install_prefix', get_option('prefix'))
config_data.set('bin_dir', get_option('bindir'))
config_data.set('exec_name', meson.project_name())
config_data.set('exec_name', install_name)

if get_option ('have_pkexec')
policy_in = configure_file(
input: 'code.policy.in.in',
output: meson.project_name() + '.policy.in',
output: install_name + '.policy.in',
configuration: config_data,
install: false,
)

i18n.merge_file(
input: policy_in,
output: meson.project_name() + '.policy',
output: install_name + '.policy',
po_dir: meson.project_source_root () / 'po' / 'extra',
install: true,
install_dir: get_option('datadir') / 'polkit-1' / 'actions',
Expand Down
4 changes: 2 additions & 2 deletions io.elementary.code.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
app-id: io.elementary.code
app-id: com.github.jeremypw.dogfood-code-7
runtime: io.elementary.Sdk # The outline plugin requires libvala which is only in the SDK, not the runtime
runtime-version: '7.1'
sdk: io.elementary.Sdk
command: io.elementary.code
command: com.github.jeremypw.dogfood-code-7
finish-args:
- '--filesystem=xdg-run/gvfsd'
- '--filesystem=host'
Expand Down
10 changes: 7 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Original project from which fork was made
project(
'io.elementary.code',
'vala', 'c',
meson_version: '>= 0.58.0',
version: '7.4.0'
)

# Install under different name so may be run alongside original
install_name = 'com.github.jeremypw.dogfood-code-7'

add_project_arguments([
'-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name())
'-DGETTEXT_PACKAGE="@0@"'.format(install_name)
],
language: 'c',
)
Expand All @@ -20,8 +24,8 @@ if get_option('have_pkexec')
add_project_arguments('--define=HAVE_PKEXEC', language: 'vala')
endif

libexecdir = get_option('prefix') / get_option('libexecdir') / meson.project_name()
pluginsdir = get_option('prefix') / get_option('libdir') / meson.project_name() / 'plugins'
libexecdir = get_option('prefix') / get_option('libexecdir') / install_name
pluginsdir = get_option('prefix') / get_option('libdir') / install_name / 'plugins'

gnome = import('gnome')
i18n = import('i18n')
Expand Down
2 changes: 1 addition & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
option ('plugins', type : 'boolean', value : true)
option('have_pkexec', type : 'boolean', value : 'true', description : 'Allow launching with pkexec. Should not be used in FlatPak')
option('development', type : 'boolean', value : false, description : 'Build is a development branch')
option('development', type : 'boolean', value : 'true', description : 'Build is a development branch')
2 changes: 1 addition & 1 deletion plugins/brackets-completion/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module_files = [
]

module_deps = [
codecore_dep,
dogfood_code_core_dep,
]

shared_module(
Expand Down
2 changes: 1 addition & 1 deletion plugins/detect-indent/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module_files = [
]

module_deps = [
codecore_dep,
dogfood_code_core_dep,
]

shared_module(
Expand Down
2 changes: 1 addition & 1 deletion plugins/editorconfig/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module_files = [
]

module_deps = [
codecore_dep,
dogfood_code_core_dep,
meson.get_compiler('c').find_library('editorconfig')
]

Expand Down
2 changes: 1 addition & 1 deletion plugins/fuzzy-search/fuzzy-search-indexer.vala
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public class Scratch.Services.FuzzySearchIndexer : GLib.Object {
processing_queue = new Gee.ConcurrentList<IndexerMessage> ();
project_paths = new Gee.HashMap<string, Services.SearchProject> ();

folder_settings = new GLib.Settings ("io.elementary.code.folder-manager");
folder_settings = new GLib.Settings ("com.github.jeremypw.dogfood-code-7.folder-manager");
folder_settings.changed["opened-folders"].connect (handle_opened_projects_change);
}

Expand Down
4 changes: 2 additions & 2 deletions plugins/fuzzy-search/fuzzy-search.vala
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class Scratch.Plugins.FuzzySearch: Peas.ExtensionBase, Peas.Activatable {

window = w;

folder_settings = new GLib.Settings ("io.elementary.code.folder-manager");
folder_settings = new GLib.Settings ("com.github.jeremypw.dogfood-code-7.folder-manager");
add_actions ();
folder_settings.changed["opened-folders"].connect (handle_opened_projects_change);
});
Expand Down Expand Up @@ -118,7 +118,7 @@ public class Scratch.Plugins.FuzzySearch: Peas.ExtensionBase, Peas.Activatable {
}

private void fuzzy_find () {
var settings = new GLib.Settings ("io.elementary.code.folder-manager");
var settings = new GLib.Settings ("com.github.jeremypw.dogfood-code-7.folder-manager");

string[] opened_folders = settings.get_strv ("opened-folders");
if (opened_folders == null || opened_folders.length < 1) {
Expand Down
2 changes: 1 addition & 1 deletion plugins/fuzzy-search/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module_files = [
]

module_deps = [
codecore_dep,
dogfood_code_core_dep,
]

shared_module(
Expand Down
Loading
Loading