""
],
"| void backSearch" : [
- "() {",
+ "(bool change_focus) {",
"",
- "}"
+ "\tif (this.searchcontext == null) {",
+ "\t\treturn;",
+ "\t} ",
+ "\t",
+ "\tGtk.TextIter beg, st,en;",
+ "\t ",
+ "\tthis.buffer.el.get_iter_at_offset(out beg, this.last_search_end);",
+ "\tif (!this.searchcontext.back(beg, out st, out en)) {",
+ "\t",
+ "\t\tthis.last_search_end = 0;",
+ "\t} else {",
+ "\t\tthis.last_search_end = en.get_offset();",
+ "\t\tif (change_focus) {",
+ "\t\t\tthis.view.el.grab_focus();",
+ "\t\t}",
+ "\t\tthis.buffer.el.place_cursor(st);",
+ "\t\tthis.view.el.scroll_to_iter(st, 0.1f, true, 0.0f, 0.5f);",
+ "\t}",
+ " ",
+ "}",
+ ""
],
"| void forwardSearch" : [
"(bool change_focus) {",
}
}
- public void backSearch () {
+ public void backSearch (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.back(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 int search (string txt) {