Skip to content

Commit

Permalink
Merge branch 'master' into jeremypw/rework-highlight-selection
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremypw authored Jan 12, 2025
2 parents 2a7161d + 72bb50c commit 6816410
Show file tree
Hide file tree
Showing 33 changed files with 209 additions and 160 deletions.
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ public class Scratch.Plugins.HighlightSelectedWords : Peas.ExtensionBase, Peas.A
Scratch.MainWindow? main_window = null;
Gtk.SourceSearchContext? current_search_context = null;

// Consts
// Pneumonoultramicroscopicsilicovolcanoconiosis longest word in a major dictionary @ 45
private const uint SELECTION_HIGHLIGHT_MAX_CHARS = 45;
private const uint SELECTION_HIGHLIGHT_MAX_CHARS = 255;

Scratch.Services.Interface plugins;
public Object object { owned get; construct; }
Expand Down
2 changes: 1 addition & 1 deletion plugins/highlight-word-selection/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/markdown-actions/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/pastebin/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module_files = [
soup_dep = dependency('libsoup-2.4')

module_deps = [
codecore_dep,
dogfood_code_core_dep,
soup_dep
]

Expand Down
2 changes: 1 addition & 1 deletion plugins/preserve-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/spell/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module_files = [
spell_dep = dependency('gtkspell3-3.0')

module_deps = [
codecore_dep,
dogfood_code_core_dep,
spell_dep
]

Expand Down
2 changes: 1 addition & 1 deletion plugins/vim-emulation/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
Loading

0 comments on commit 6816410

Please sign in to comment.