Fix regex search for cursor matches
@@ -203,6 +203,20 @@ impl Find {
break;
}
+ // in case current cursor matches search result (for example query a* matches)
+ // all cursor positions, then cursor needs to be increased so that search
+ // continues at next position. Otherwise, search will result in overflow since
+ // search will always repeat at current cursor position.
+ if start == end {
+ // determine whether end of text is reached and stop search or increase
+ // cursor manually
+ if end + 1 >= text_len {
+ break;
+ } else {
+ cursor.set(end + 1);
+ }
+ }
+
if stop_on_found {
searched_until = end;
break;
