Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions data/io.elementary.code.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@
<summary>Highlight Matching Brackets</summary>
<description>Whether Code should highlight matching brackets.</description>
</key>
<key name="syntax-highlighting" type="b">
<default>true</default>
<summary>Highlight source code syntax</summary>
<description>Whether Code should apply syntax highlighting to documents.</description>
</key>
<key name="draw-spaces" enum="io.elementary.code.draw-spaces-states">
<default>"For Selection"</default>
<summary>Draw spaces and tabs with symbols</summary>
Expand Down
1 change: 1 addition & 0 deletions src/Dialogs/PreferencesDialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public class Scratch.Dialogs.Preferences : Granite.Dialog {
var editor_box = new Gtk.Box (VERTICAL, 12);
editor_box.add (new Granite.HeaderLabel (_("Editor")));
editor_box.add (new SettingSwitch (_("Highlight matching brackets"), "highlight-matching-brackets"));
editor_box.add (new SettingSwitch (_("Syntax highlighting"), "syntax-highlighting"));
editor_box.add (draw_spaces_box);
editor_box.add (new SettingSwitch (_("Mini Map"), "show-mini-map"));
editor_box.add (new SettingSwitch (_("Wrap lines"), "line-wrap"));
Expand Down
2 changes: 1 addition & 1 deletion src/Widgets/FormatBar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class Code.FormatBar : Gtk.Box {

lang_menubutton = new FormatButton () {
icon = new ThemedIcon ("application-x-class-file-symbolic"),
tooltip_text = _("Syntax Highlighting")
tooltip_text = _("Document language")
};

line_menubutton = new FormatButton () {
Expand Down
3 changes: 2 additions & 1 deletion src/Widgets/SourceView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ namespace Scratch.Widgets {

var source_buffer = new Gtk.SourceBuffer (null);
set_buffer (source_buffer);
source_buffer.highlight_syntax = true;
source_buffer.highlight_syntax = Scratch.settings.get_boolean ("syntax-highlighting");
source_buffer.mark_set.connect (on_mark_set);
source_buffer.mark_deleted.connect (on_mark_deleted);
highlight_current_line = true;
Expand Down Expand Up @@ -239,6 +239,7 @@ namespace Scratch.Widgets {
insert_spaces_instead_of_tabs = Scratch.settings.get_boolean ("spaces-instead-of-tabs");
var source_buffer = (Gtk.SourceBuffer) buffer;
source_buffer.highlight_matching_brackets = Scratch.settings.get_boolean ("highlight-matching-brackets");
source_buffer.highlight_syntax = Scratch.settings.get_boolean ("syntax-highlighting");
space_drawer.enable_matrix = false;
switch ((ScratchDrawSpacesState) Scratch.settings.get_enum ("draw-spaces")) {
case ScratchDrawSpacesState.ALWAYS:
Expand Down
Loading