src/Builder4/PopoverEditor.bjs
authorAlan <alan@roojs.com>
Thu, 12 May 2022 09:23:05 +0000 (17:23 +0800)
committerAlan <alan@roojs.com>
Thu, 12 May 2022 09:23:05 +0000 (17:23 +0800)
src/Builder4/PopoverEditor.vala
src/Builder4/Editor.bjs
src/Builder4/Editor.vala

src/Builder4/PopoverEditor.bjs
src/Builder4/PopoverEditor.vala

index 1debb59..615feff 100644 (file)
     "}",
     ""
    ],
-   "| return_type forwardSearch" : [
+   "| void clear" : [
+    "() {",
+    " this.model.el.clear();",
+    "}",
+    ""
+   ],
+   "| void forwardSearch" : [
     "(bool change_focus) {",
     "",
     "\tif (this.searchcontext == null) {",
     "}",
     ""
    ],
-   "| void clear" : [
-    "() {",
-    " this.model.el.clear();",
-    "}",
-    ""
-   ],
    "| void hide" : [
     "() {",
     "\tthis.prop_or_listener = \"\";",
index 05bb498..c5e0465 100644 (file)
@@ -149,28 +149,6 @@ public class Xcls_PopoverEditor : Object
        
        return this.searchcontext.get_occurrences_count();
      
-    }
-    public return_type forwardSearch (bool change_focus) {
-    
-       if (this.searchcontext == null) {
-               return;
-       }
-       
-       Gtk.TextIter beg, st,en;
-        
-       this.buffer.el.get_iter_at_offset(out beg, this.last_search_end);
-       if (!this.searchcontext.forward(beg, out st, out en)) {
-       
-               this.last_search_end = 0;
-       } else {
-               this.last_search_end = en.get_offset();
-               if (change_focus) {
-                       this.view.el.grab_focus();
-               }
-               this.buffer.el.place_cursor(st);
-               this.view.el.scroll_to_iter(st,  0.1f, true, 0.0f, 0.5f);
-       }
-    
     }
     public bool saveContents ()  {
         
@@ -218,6 +196,28 @@ public class Xcls_PopoverEditor : Object
     public void clear () {
      this.model.el.clear();
     }
+    public void forwardSearch (bool change_focus) {
+    
+       if (this.searchcontext == null) {
+               return;
+       }
+       
+       Gtk.TextIter beg, st,en;
+        
+       this.buffer.el.get_iter_at_offset(out beg, this.last_search_end);
+       if (!this.searchcontext.forward(beg, out st, out en)) {
+       
+               this.last_search_end = 0;
+       } else {
+               this.last_search_end = en.get_offset();
+               if (change_focus) {
+                       this.view.el.grab_focus();
+               }
+               this.buffer.el.place_cursor(st);
+               this.view.el.scroll_to_iter(st,  0.1f, true, 0.0f, 0.5f);
+       }
+    
+    }
     public class Xcls_Box2 : Object
     {
         public Gtk.Box el;