Merge lp:~davidgomes/scratch/fix-899592 into lp:~registry/scratch/scratch

Proposed by David Gomes
Status: Merged
Merged at revision: 411
Proposed branch: lp:~davidgomes/scratch/fix-899592
Merge into: lp:~registry/scratch/scratch
Diff against target: 86 lines (+14/-1)
4 files modified
org.elementary.scratch.gschema.xml (+5/-0)
scratchcore/Settings.vala (+1/-0)
scratchcore/SourceView.vala (+3/-1)
src/Dialogs/PreferencesDialog.vala (+5/-0)
To merge this branch: bzr merge lp:~davidgomes/scratch/fix-899592
Reviewer Review Type Date Requested Status
Registry Administrators Pending
Review via email: mp+84368@code.launchpad.net

Description of the change

Basically there's now an option (deactivated as default) that lets the user highlight matching brackets.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'org.elementary.scratch.gschema.xml'
2--- org.elementary.scratch.gschema.xml 2011-11-30 18:32:32 +0000
3+++ org.elementary.scratch.gschema.xml 2011-12-03 14:27:35 +0000
4@@ -81,6 +81,11 @@
5 <default>true</default>
6 <summary>Highlight Current Line</summary>
7 <description>Whether Scratch should highlight the current line.</description>
8+ </key>
9+ <key name="highlight-matching-brackets" type="b">
10+ <default>false</default>
11+ <summary>Highlight Matching Brackets</summary>
12+ <description>Whether Scratch should highlight matching brackets.</description>
13 </key>
14 <key name="spaces-instead-of-tabs" type="b">
15 <default>false</default>
16
17=== modified file 'scratchcore/Settings.vala'
18--- scratchcore/Settings.vala 2011-12-01 19:22:22 +0000
19+++ scratchcore/Settings.vala 2011-12-03 14:27:35 +0000
20@@ -44,6 +44,7 @@
21 public bool modal_dialog { get; set; }
22 public bool show_line_numbers { get; set; }
23 public bool highlight_current_line { get; set; }
24+ public bool highlight_matching_brackets { get; set; }
25 public bool spaces_instead_of_tabs { get; set; }
26 public bool auto_indent { get; set; }
27 public int indent_width { get; set; }
28
29=== modified file 'scratchcore/SourceView.vala'
30--- scratchcore/SourceView.vala 2011-12-01 19:22:22 +0000
31+++ scratchcore/SourceView.vala 2011-12-03 14:27:35 +0000
32@@ -60,7 +60,7 @@
33
34 Scratch.settings.changed.connect (restore_settings);
35
36- if(plugins != null)
37+ if (plugins != null)
38 plugins.hook_source_view(this);
39
40 }
41@@ -129,6 +129,7 @@
42 right_margin_position = Scratch.settings.right_margin_position;
43 show_line_numbers = Scratch.settings.show_line_numbers;
44 highlight_current_line = Scratch.settings.highlight_current_line;
45+ buffer.highlight_matching_brackets = Scratch.settings.highlight_matching_brackets;
46 insert_spaces_instead_of_tabs = Scratch.settings.spaces_instead_of_tabs;
47 tab_width = (uint) Scratch.settings.indent_width;
48
49@@ -146,6 +147,7 @@
50 Scratch.settings.show_right_margin = show_right_margin;
51 Scratch.settings.right_margin_position = (int) right_margin_position;
52 Scratch.settings.highlight_current_line = highlight_current_line;
53+ Scratch.settings.highlight_matching_brackets = buffer.highlight_matching_brackets;
54 Scratch.settings.spaces_instead_of_tabs = insert_spaces_instead_of_tabs;
55 Scratch.settings.indent_width = (int) tab_width;
56 Scratch.settings.font = current_font;
57
58=== modified file 'src/Dialogs/PreferencesDialog.vala'
59--- src/Dialogs/PreferencesDialog.vala 2011-12-01 19:41:01 +0000
60+++ src/Dialogs/PreferencesDialog.vala 2011-12-03 14:27:35 +0000
61@@ -33,6 +33,7 @@
62 private Switch show_right_margin;
63 private Switch line_numbers;
64 private Switch highlight_current_line;
65+ private Switch highlight_matching_brackets;
66 private Switch spaces_instead_of_tabs;
67 private Switch auto_indent;
68 private SpinButton indent_width;
69@@ -213,6 +214,9 @@
70 highlight_current_line = new Switch ();
71 Scratch.settings.schema.bind("highlight-current-line", highlight_current_line, "active", SettingsBindFlags.DEFAULT);
72
73+ highlight_matching_brackets = new Switch ();
74+ Scratch.settings.schema.bind("highlight-matching-brackets", highlight_matching_brackets, "active", SettingsBindFlags.DEFAULT);
75+
76 spaces_instead_of_tabs = new Switch ();
77 Scratch.settings.schema.bind("spaces-instead-of-tabs", spaces_instead_of_tabs, "active", SettingsBindFlags.DEFAULT);
78
79@@ -225,6 +229,7 @@
80 int row = 0;
81 add_option (content, new Label (_("Show line numbers:")), line_numbers, ref row);
82 add_option (content, new Label (_("Highlight current line:")), highlight_current_line, ref row);
83+ add_option (content, new Label (_("Highlight matching brackets:")), highlight_matching_brackets, ref row);
84 add_option (content, new Label (_("Use spaces instead of tabs:")), spaces_instead_of_tabs, ref row);
85 add_option (content, new Label (_("Tab width:")), indent_width, ref row);
86 add_option (content, new Label (_("Use auto indent:")), auto_indent, ref row);

Subscribers

People subscribed via source and target branches