src/Builder4/Editor.bjs
authorAlan <alan@roojs.com>
Thu, 18 Aug 2022 10:23:25 +0000 (18:23 +0800)
committerAlan <alan@roojs.com>
Thu, 18 Aug 2022 10:23:25 +0000 (18:23 +0800)
src/Builder4/Editor.vala

src/Builder4/Editor.bjs
src/Builder4/Editor.vala

index d10b798..200396a 100644 (file)
     "\tvar s = new Gtk.SourceSearchSettings();",
     "\ts.case_sensitive = _this.case_sensitive.el.active;",
     "\ts.regex_enabled = _this.regex.el.active;\t",
+    "\ts.wrap_around = false;",
     "\t",
     "\tthis.searchcontext = new Gtk.SourceSearchContext(this.buffer.el,s);",
     "\tthis.searchcontext.set_highlight(true);",
     "\t",
+    "\tif (_this.mutiline.el.active) {",
+    "\t\ttxt = txt.replace(\"\\\\n\", \"\\n\");",
+    "\t}",
     "\t",
     "\ts.set_search_text(txt);",
     "\tGtk.TextIter beg, st,en;",
index 84a0e52..3bf866a 100644 (file)
@@ -178,10 +178,14 @@ public class Editor : Object
        var s = new Gtk.SourceSearchSettings();
        s.case_sensitive = _this.case_sensitive.el.active;
        s.regex_enabled = _this.regex.el.active;        
+       s.wrap_around = false;
        
        this.searchcontext = new Gtk.SourceSearchContext(this.buffer.el,s);
        this.searchcontext.set_highlight(true);
        
+       if (_this.mutiline.el.active) {
+               txt = txt.replace("\\n", "\n");
+       }
        
        s.set_search_text(txt);
        Gtk.TextIter beg, st,en;