Skip to content

Commit

Permalink
Merge branch 'master' into jeremypw/symbol-pane-scroll-doc-on-click
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit authored Mar 8, 2025
2 parents ce496d9 + c96f526 commit 5b03a66
Show file tree
Hide file tree
Showing 607 changed files with 16,140 additions and 14,157 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,37 +32,35 @@ jobs:
flatpak:
name: Flatpak
runs-on: ubuntu-latest
runs-on: ${{ matrix.configuration.runs-on }}

strategy:
matrix:
arch: [x86_64, aarch64]
configuration:
- arch: x86_64
runs-on: ubuntu-latest
- arch: aarch64
runs-on: ubuntu-24.04-arm
# Don't fail the whole workflow if one architecture fails
fail-fast: false

container:
image: ghcr.io/elementary/flatpak-platform/runtime:7.1-${{ matrix.arch }}
image: ghcr.io/elementary/flatpak-platform/runtime:8-${{ matrix.configuration.arch }}
options: --privileged

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU for aarch64 emulation
if: ${{ matrix.arch != 'x86_64' }}
uses: docker/setup-qemu-action@v3
with:
platforms: arm64

- name: Build
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
uses: flatpak/flatpak-github-actions/flatpak-builder@v6.4
with:
bundle: code.flatpak
manifest-path: io.elementary.code.yml
repository-name: appcenter
repository-url: https://flatpak.elementary.io/repo.flatpakrepo
cache-key: "flatpak-builder-${{ github.sha }}"
arch: ${{ matrix.arch }}
arch: ${{ matrix.configuration.arch }}

lint:
name: Lint
Expand Down
99 changes: 52 additions & 47 deletions plugins/editorconfig/editorconfig.vala
Original file line number Diff line number Diff line change
Expand Up @@ -32,60 +32,65 @@ public class Scratch.Plugins.EditorConfigPlugin: Peas.ExtensionBase, Peas.Activa
});

plugins.hook_document.connect ((d) => {
// Ensure use global settings by default
format_bar.tab_style_set_by_editor_config = false;
format_bar.tab_width_set_by_editor_config = false;
format_bar.set_document (d);
update_config.begin (d);
});

Scratch.Widgets.SourceView view = d.source_view;
File file = d.file;
}

if (file == null || !file.query_exists ()) {
return;
}
private async void update_config (Scratch.Services.Document d) {
// Ensure use global settings by default
format_bar.tab_style_set_by_editor_config = false;
format_bar.tab_width_set_by_editor_config = false;
format_bar.set_document (d);

var handle = new EditorConfig.Handle ();
handle.set_conf_file_name (".editorconfig");
if (handle.parse (file.get_path ()) != 0) {
return;
}
Scratch.Widgets.SourceView view = d.source_view;
File file = d.file;

for (int i = 0; i < handle.get_name_value_count (); i++) {
string name, val;
handle.get_name_value (i, out name, out val);
/* These are all properties (https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties) */
switch (name) {
case "indent_style":
format_bar.tab_style_set_by_editor_config = true;
var use_spaces = (val != "tab");
format_bar.set_insert_spaces_instead_of_tabs (use_spaces);
break;
case "indent_size":
case "tab_width":
format_bar.tab_width_set_by_editor_config = true;
var indent_width = (int.parse (val)).clamp (2, 16);
format_bar.set_tab_width (indent_width);
break;
case "end_of_line":
break;
case "charset":
break;
case "trim_trailing_whitespace":
break;
case "insert_final_newline":
break;
case "max_line_length":
view.right_margin_position = int.parse (val);
break;
default:
warning ("unrecognised name/value %s/%s", name, val);
break;
}
if (file == null || !file.query_exists ()) {
return;
}

var handle = new EditorConfig.Handle ();
handle.set_conf_file_name (".editorconfig");
if (handle.parse (file.get_path ()) != 0) {
return;
}

for (int i = 0; i < handle.get_name_value_count (); i++) {
string name, val;
handle.get_name_value (i, out name, out val);
/* These are all properties (https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties) */
switch (name) {
case "indent_style":
format_bar.tab_style_set_by_editor_config = true;
var use_spaces = (val != "tab");
format_bar.set_insert_spaces_instead_of_tabs (use_spaces);
break;
case "indent_size":
case "tab_width":
format_bar.tab_width_set_by_editor_config = true;
var indent_width = (int.parse (val)).clamp (2, 16);
format_bar.set_tab_width (indent_width);
break;
case "end_of_line":
break;
case "charset":
break;
case "trim_trailing_whitespace":
break;
case "insert_final_newline":
break;
case "max_line_length":
view.right_margin_position = int.parse (val);
break;
default:
warning ("unrecognised name/value %s/%s", name, val);
break;
}
});
}
}

public void deactivate () { }
public void deactivate () { debug ("Editor config deactivate");}
}

[ModuleInit]
Expand Down
1 change: 1 addition & 0 deletions po/POTFILES
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ src/FolderManager/Item.vala
src/FolderManager/ProjectFolderItem.vala
src/Services/Document.vala
src/Services/FileHandler.vala
src/Services/MonitoredRepository.vala
src/Services/PluginManager.vala
src/Services/Settings.vala
src/Services/TemplateManager.vala
Expand Down
Loading

0 comments on commit 5b03a66

Please sign in to comment.