Merge lp:~tintou/scratch/fix-replace-all into lp:~elementary-apps/scratch/scratch

Proposed by Corentin Noël
Status: Merged
Approved by: Cody Garver
Approved revision: 1509
Merged at revision: 1509
Proposed branch: lp:~tintou/scratch/fix-replace-all
Merge into: lp:~elementary-apps/scratch/scratch
Diff against target: 56 lines (+8/-8)
1 file modified
src/Widgets/SearchManager.vala (+8/-8)
To merge this branch: bzr merge lp:~tintou/scratch/fix-replace-all
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+259217@code.launchpad.net

Commit message

Use the same feature as the saving functions.

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 'src/Widgets/SearchManager.vala'
2--- src/Widgets/SearchManager.vala 2014-10-03 19:54:19 +0000
3+++ src/Widgets/SearchManager.vala 2015-05-15 09:29:00 +0000
4@@ -165,7 +165,7 @@
5 }
6
7 if (this.text_view != null)
8- this.text_buffer.changed.disconnect (on_text_buffer_changed);
9+ this.text_buffer.modified_changed.disconnect (on_text_buffer_modified);
10
11 this.text_view = text_view;
12 this.text_buffer = text_view.get_buffer ();
13@@ -188,7 +188,7 @@
14 }
15
16 update_go_to_entry ();
17- this.text_buffer.changed.connect (on_text_buffer_changed);
18+ this.text_buffer.modified_changed.connect (on_text_buffer_modified);
19 }
20
21 void on_go_to_entry_activate () {
22@@ -223,17 +223,17 @@
23 }
24 string replace_string = replace_entry.text;
25 // temporarily disable all textbuffer changed signal handlers
26- this.text_buffer.changed.disconnect (on_text_buffer_changed);
27+ this.text_buffer.modified_changed.disconnect (on_text_buffer_modified);
28 this.window.get_current_document ().toggle_changed_handlers (false);
29 var replaced = search_context.replace_all (replace_string, replace_string.length);
30 update_tool_arrows (search_entry.text);
31 update_replace_tool_sensitivities (search_entry.text, false);
32 // reenable all disabled buffer changed signal handlers
33- this.text_buffer.changed.connect (on_text_buffer_changed);
34+ this.text_buffer.modified_changed.connect (on_text_buffer_modified);
35 this.window.get_current_document ().toggle_changed_handlers (true);
36 // notify the buffer of the change after replace all
37 if (replaced > 0)
38- this.text_buffer.changed ();
39+ this.text_buffer.modified_changed ();
40 }
41
42 public void set_search_string (string to_search) {
43@@ -469,9 +469,9 @@
44 //Set the maximum range of the "Go To Line" spinbutton.
45 go_to_entry.set_range (1, text_buffer.get_line_count ());
46 }
47-
48- void on_text_buffer_changed () {
49+
50+ void on_text_buffer_modified () {
51 update_go_to_entry ();
52 }
53 }
54-}
55\ No newline at end of file
56+}

Subscribers

People subscribed via source and target branches