Skip to content

Commit

Permalink
Merge branch 'master' into draw-spaces-on-current-line-option
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Wootten authored Aug 2, 2023
2 parents b1ff9b5 + 9babc15 commit 0247797
Show file tree
Hide file tree
Showing 624 changed files with 30,159 additions and 24,958 deletions.
26 changes: 16 additions & 10 deletions data/code.metainfo.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<update_contact>contact_AT_elementary.io</update_contact>

<releases>
<release version="7.1.0" date="2023-04-06" urgency="medium">
<release version="7.1.0" date="2023-07-28" urgency="medium">
<description>
<p>Improvements:</p>
<ul>
Expand All @@ -84,27 +84,33 @@
<li>Now there is always an active project at startup if there are projects in the sidebar</li>
<li>If a development branch is running this shows in the window title and in the dock tooltip</li>
<li>Ctrl+PageUp and Ctrl+PageDown shortcuts now switch tabs</li>
<li>Ensure active project at startup (include non-git folders)</li>
<li>Updated translations</li>
</ul>
</description>
<issues>
<issue url="https://github.com/elementary/code/issues/739">No expander on folders that contain no text files</issue>
<issue url="https://github.com/elementary/code/issues/933">Add whole word search</issue>
<issue url="https://github.com/elementary/code/issues/965">Undo-ing sometimes deletes the entire contents of a file</issue>
<issue url="https://github.com/elementary/code/issues/1175">Search occurence label does not update when active document changed</issue>
<issue url="https://github.com/elementary/code/issues/1183">Autosave of unsaved buffers not reliable</issue>
<issue url="https://github.com/elementary/code/issues/1208">Slow to close multiple documents</issue>
<issue url="https://github.com/elementary/code/issues/1210">Unexpected closing on pressing Global Search accelerator with no open documents</issue>
<issue url="https://github.com/elementary/code/issues/1248">Clicking "Find in Project…" in the welcome screen causes the app crashing</issue>
<issue url="https://github.com/elementary/code/issues/1256">Cancelling saving does not work as expected when closing project folder resulting in data loss</issue>
<issue url="https://github.com/elementary/code/issues/1261">Saving new document to an unwritable location gives unexpected behaviour and possible data loss</issue>
<issue url="https://github.com/elementary/code/issues/1263">Symbol outline does not respect system style</issue>
<issue url="https://github.com/elementary/code/issues/1266">"Replace All" should not disable the "Replace" and "Replace All" buttons</issue>
<issue url="https://github.com/elementary/code/issues/1270">Does not follow system color scheme when launching with no files open</issue>
<issue url="https://github.com/elementary/code/issues/1272">Secure WebDav files opened from Files cannot save</issue>
<issue url="https://github.com/elementary/code/issues/1275">Case sensitive/insensitive search does not work as expected with mixed case search term</issue>
<issue url="https://github.com/elementary/code/issues/1282">Cannot open files with unknown characters</issue>
<issue url="https://github.com/elementary/code/issues/1293">Search results change when document focused in</issue>
<issue url="https://github.com/elementary/code/pull/1254">Ensure active project at startup (include non-git folders)</issue>
<issue url="https://github.com/elementary/code/pull/1248">Clicking "Find in Project…" in the welcome screen causes the app crashing</issue>
<issue url="https://github.com/elementary/code/pull/1210">Unexpected closing on pressing Global Search accelerator with no open documents</issue>
<issue url="https://github.com/elementary/code/pull/1266">"Replace All" should not disable the "Replace" and "Replace All" buttons</issue>
<issue url="https://github.com/elementary/code/pull/1272">Secure WebDav files opened from Files cannot save</issue>
<issue url="https://github.com/elementary/code/pull/1256">Cancelling saving does not work as expected when closing project folder resulting in data loss</issue>
<issue url="https://github.com/elementary/code/pull/1183">Autosave of unsaved buffers not reliable</issue>
<issue url="https://github.com/elementary/code/pull/1282">Cannot open files with unknown characters</issue>
<issue url="https://github.com/elementary/code/pull/1252">No expander on folders that contain no text files</issue>
<issue url="https://github.com/elementary/code/issues/1319">Document does not open when sidebar entry clicked if it is already focused</issue>
<issue url="https://github.com/elementary/code/issues/1327">Git branch change can result in unwanted warnings</issue>
<issue url="https://github.com/elementary/code/issues/1335">Search entry reverts to previous term after editing and pressing Control+f</issue>
<issue url="https://github.com/elementary/code/issues/1340">Tab width menu does not work</issue>
<issue url="https://github.com/elementary/code/issues/1341">Line numbers should start from one not zero</issue>
</issues>
</release>

Expand Down
1 change: 1 addition & 0 deletions data/io.elementary.code.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
<description>Whether Code should use auto indentation</description>
</key>
<key name="indent-width" type="i">
<range min="2" max="16"/>
<default>4</default>
<summary>Tab Size</summary>
<description>Specifies the number of spaces that should be displayed instead of Tab characters.</description>
Expand Down
16 changes: 8 additions & 8 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ endforeach
install_data([
'styles/elementary-dark.xml',
'styles/elementary-light.xml',
], install_dir: join_paths(get_option('datadir'), 'gtksourceview-4', 'styles'))
], install_dir: get_option('datadir') / 'gtksourceview-4' / 'styles')

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

install_data(
'io.elementary.code.gschema.xml',
'io.elementary.code.plugins.spell.gschema.xml',
install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'glib-2.0', 'schemas')
install_dir: get_option('prefix') / get_option('datadir') / 'glib-2.0' / 'schemas'
)

config_data = configuration_data()
Expand All @@ -47,16 +47,16 @@ desktop_in_file = configure_file(
desktop_file = i18n.merge_file(
input: desktop_in_file,
output: 'io.elementary.code.desktop',
po_dir: join_paths(meson.source_root (), 'po', 'extra'),
po_dir: meson.project_source_root () / 'po' / 'extra',
type: 'desktop',
install_dir: join_paths(get_option('datadir'), 'applications'),
install_dir: get_option('datadir') / 'applications',
install: true
)

i18n.merge_file(
input: 'code.metainfo.xml.in',
output: meson.project_name() + '.metainfo.xml',
po_dir: meson.source_root() / 'po' / 'extra',
po_dir: meson.project_source_root() / 'po' / 'extra',
type: 'xml',
install: true,
install_dir: get_option('datadir') / 'metainfo',
Expand All @@ -78,9 +78,9 @@ if get_option ('have_pkexec')
i18n.merge_file(
input: policy_in,
output: meson.project_name() + '.policy',
po_dir: join_paths(meson.source_root (), 'po', 'extra'),
po_dir: meson.project_source_root () / 'po' / 'extra',
install: true,
install_dir: join_paths(get_option('datadir'), 'polkit-1', 'actions'),
install_dir: get_option('datadir') / 'polkit-1' / 'actions',
)
endif

Expand Down
13 changes: 7 additions & 6 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
project(
'io.elementary.code',
'vala', 'c',
version: '7.0.0'
meson_version: '>= 0.58.0',
version: '7.1.0'
)

add_project_arguments([
Expand All @@ -11,16 +12,16 @@ add_project_arguments([
)

add_project_arguments(
['--vapidir', join_paths(meson.current_source_dir(), 'vapi')],
['--vapidir', meson.project_source_root() / 'vapi'],
language: 'vala'
)

if get_option('have_pkexec')
add_project_arguments('--define=HAVE_PKEXEC', language: 'vala')
endif

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

gnome = import('gnome')
i18n = import('i18n')
Expand All @@ -46,7 +47,7 @@ code_resources = gnome.compile_resources(
)

# We need libvala-X.XX library, but it changes depending on the version that is installed
vala_version = run_command (meson.get_compiler('vala'), '--api-version').stdout().strip()
vala_version = run_command (meson.get_compiler('vala'), '--api-version', check: true).stdout().strip()
vala_dep = dependency('libvala-@0@'.format(vala_version))

dependencies = [
Expand Down Expand Up @@ -81,4 +82,4 @@ if get_option('plugins')
endif
subdir('po')

meson.add_install_script('meson/post_install.py')
gnome.post_install(glib_compile_schemas: true)
10 changes: 0 additions & 10 deletions meson/post_install.py

This file was deleted.

6 changes: 3 additions & 3 deletions plugins/brackets-completion/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ shared_module(
module_files,
dependencies: module_deps,
install: true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)

custom_target(module_name + '.plugin_merge',
Expand All @@ -23,10 +23,10 @@ custom_target(module_name + '.plugin_merge',
'--desktop',
'--keyword=Description',
'--keyword=Name',
'-d' + join_paths(meson.source_root (), 'po', 'plugins'),
'-d' + meson.project_source_root () / 'po' / 'plugins',
'--template=@INPUT@',
'-o@OUTPUT@',
],
install : true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)
6 changes: 3 additions & 3 deletions plugins/detect-indent/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ shared_module(
module_files,
dependencies: module_deps,
install: true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)

custom_target(module_name + '.plugin_merge',
Expand All @@ -23,10 +23,10 @@ custom_target(module_name + '.plugin_merge',
'--desktop',
'--keyword=Description',
'--keyword=Name',
'-d' + join_paths(meson.source_root (), 'po', 'plugins'),
'-d' + meson.project_source_root () / 'po' / 'plugins',
'--template=@INPUT@',
'-o@OUTPUT@',
],
install : true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)
13 changes: 10 additions & 3 deletions plugins/editorconfig/editorconfig.vala
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ public class Scratch.Plugins.EditorConfigPlugin: Peas.ExtensionBase, Peas.Activa
});

plugins.hook_document.connect ((d) => {
format_bar.tab_set_by_editor_config = false;
// 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);

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

Expand All @@ -52,13 +56,13 @@ public class Scratch.Plugins.EditorConfigPlugin: Peas.ExtensionBase, Peas.Activa
/* These are all properties (https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties) */
switch (name) {
case "indent_style":
format_bar.tab_set_by_editor_config = true;
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_set_by_editor_config = true;
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;
Expand All @@ -73,6 +77,9 @@ public class Scratch.Plugins.EditorConfigPlugin: Peas.ExtensionBase, Peas.Activa
case "max_line_length":
view.right_margin_position = int.parse (val);
break;
default:
warning ("unrecognised name/value %s/%s", name, val);
break;
}
}
});
Expand Down
6 changes: 3 additions & 3 deletions plugins/editorconfig/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ shared_module(
module_files,
dependencies: module_deps,
install: true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)

custom_target(module_name + '.plugin_merge',
Expand All @@ -25,10 +25,10 @@ custom_target(module_name + '.plugin_merge',
'--desktop',
'--keyword=Description',
'--keyword=Name',
'-d' + join_paths(meson.source_root (), 'po', 'plugins'),
'-d' + meson.project_source_root () / 'po' / 'plugins',
'--template=@INPUT@',
'-o@OUTPUT@',
],
install : true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)
56 changes: 37 additions & 19 deletions plugins/highlight-word-selection/highlight-word-selection.vala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@

public class Scratch.Plugins.HighlightSelectedWords : Peas.ExtensionBase, Peas.Activatable {
Scratch.Widgets.SourceView current_source;
Gtk.SourceSearchContext current_search_context;
Scratch.MainWindow? main_window = null;
Gtk.SourceSearchContext? current_search_context = null;

// Consts
// Pneumonoultramicroscopicsilicovolcanoconiosis longest word in a major dictionary @ 45
Expand All @@ -43,33 +44,50 @@ public class Scratch.Plugins.HighlightSelectedWords : Peas.ExtensionBase, Peas.A
current_source.deselected.connect (on_deselection);
current_source.selection_changed.connect (on_selection_changed);
});

plugins.hook_window.connect ((w) => {
main_window = w;
});
}

public void on_selection_changed (ref Gtk.TextIter start, ref Gtk.TextIter end) {
if (!start.equal (end)) {
// Expand highlight to current word
if (!start.starts_word ()) {
start.backward_word_start ();
}

if (!end.ends_word ()) {
end.forward_word_end ();
var window_search_context = main_window != null ? main_window.search_bar.search_context : null;
if (window_search_context == null ||
window_search_context.settings.search_text == "" ||
window_search_context.get_occurrences_count () == 0) {

if (!start.equal (end)) {
// Expand highlight to current word
if (!start.starts_word ()) {
start.backward_word_start ();
}

if (!end.ends_word ()) {
end.forward_word_end ();
}

string selected_text = start.get_buffer ().get_text (start, end, false);
if (selected_text.char_count () > SELECTION_HIGHLIGHT_MAX_CHARS) {
return;
}

current_search_context = new Gtk.SourceSearchContext ((Gtk.SourceBuffer)current_source.buffer, null);
current_search_context.settings.search_text = selected_text;
// Honor current search settings (to be confirmed)
if (window_search_context != null ) {
current_search_context.settings.case_sensitive = window_search_context.settings.case_sensitive;
}
}

string selected_text = start.get_buffer ().get_text (start, end, false);
if (selected_text.char_count () > SELECTION_HIGHLIGHT_MAX_CHARS) {
return;
}

current_search_context = new Gtk.SourceSearchContext ((Gtk.SourceBuffer)current_source.buffer, null);
current_search_context.settings.search_text = selected_text;
current_search_context.set_highlight (true);
} else if (current_search_context != null) {
current_search_context.set_highlight (false);
current_search_context = null;
}
}

public void on_deselection () {
if (current_search_context != null) {
current_search_context.settings.search_text = null;
current_search_context.set_highlight (false);
current_search_context = null;
}
}

Expand Down
6 changes: 3 additions & 3 deletions plugins/highlight-word-selection/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ shared_module(
module_files,
dependencies: module_deps,
install: true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)

custom_target(module_name + '.plugin_merge',
Expand All @@ -23,10 +23,10 @@ custom_target(module_name + '.plugin_merge',
'--desktop',
'--keyword=Description',
'--keyword=Name',
'-d' + join_paths(meson.source_root (), 'po', 'plugins'),
'-d' + meson.project_source_root () / 'po' / 'plugins',
'--template=@INPUT@',
'-o@OUTPUT@',
],
install : true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)
6 changes: 3 additions & 3 deletions plugins/markdown-actions/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ shared_module(
module_files,
dependencies: module_deps,
install: true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)

custom_target(module_name + '.plugin_merge',
Expand All @@ -23,10 +23,10 @@ custom_target(module_name + '.plugin_merge',
'--desktop',
'--keyword=Description',
'--keyword=Name',
'-d' + join_paths(meson.source_root (), 'po', 'plugins'),
'-d' + meson.project_source_root () / 'po' / 'plugins',
'--template=@INPUT@',
'-o@OUTPUT@',
],
install : true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)
Loading

0 comments on commit 0247797

Please sign in to comment.