summaryrefslogtreecommitdiff
path: root/fluid/sourceview_panel.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-11-16 11:20:42 +0100
committerMatthias Melcher <github@matthiasm.com>2023-11-16 11:20:42 +0100
commitd28d03e1aca7d2e4d3b625a95912f0cebf9bac10 (patch)
tree88523cc60017a40873410e2a1449d8659dc2d2a6 /fluid/sourceview_panel.cxx
parent348c1876e6312e7c0967b790c898b4094c459fd3 (diff)
FLUID: Adds wrapping to "find" in source view.
Diffstat (limited to 'fluid/sourceview_panel.cxx')
-rw-r--r--fluid/sourceview_panel.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/fluid/sourceview_panel.cxx b/fluid/sourceview_panel.cxx
index 3eb3f9669..b32f01498 100644
--- a/fluid/sourceview_panel.cxx
+++ b/fluid/sourceview_panel.cxx
@@ -32,7 +32,7 @@ extern void reveal_in_browser(Fl_Type *t);
/**
Update the header and source code highlighting depending on the
currently selected object
-
+
The Source View system offers an immediate preview of the code
files that will be generated by FLUID. It also marks the code
generated for the last selected item in the header and the source
@@ -309,6 +309,8 @@ static void cb_(Fl_Button*, void*) {
int pos = e->insert_position()-1;
if (pos < 0) pos = b->length()-1;
int found = b->search_backward(pos, needle, &pos, sv_find_text_case->value());
+ if (!found)
+ found = b->search_backward(b->length()-1, needle, &pos, sv_find_text_case->value());
if (found) {
b->select(pos, pos + (int)strlen(needle));
e->insert_position(pos);
@@ -332,6 +334,8 @@ static void cb_1(Fl_Button*, void*) {
int pos = e->insert_position() + 1;
if (pos+1 >= b->length()) pos = 0;
int found = b->search_forward(pos, needle, &pos, sv_find_text_case->value());
+ if (!found && (pos > 0))
+ found = b->search_forward(0, needle, &pos, sv_find_text_case->value());
if (found) {
b->select(pos, pos + (int)strlen(needle));
e->insert_position(pos);