+ function SearchCursor(editor, string, fromCursor, regexp, case_sensitive) {
+
+ function casedIndexOf(hay, needle, case_sensitive) {
+ if (case_sensitive)
+ return hay.indexOf(needle);
+ else
+ return hay.toLowerCase().indexOf(needle.toLowerCase())
+ }
+
+ function casedLastIndexOf(hay, needle, case_sensitive) {
+ if (case_sensitive)
+ return hay.lastIndexOf(needle);
+ else
+ return hay.toLowerCase().lastIndexOf(needle.toLowerCase());
+ }
+
+ function casedEqual(a, b, case_sensitive) {
+ if (case_sensitive)
+ return a == b;
+ else
+ return a.toLowerCase() == b.toLowerCase();
+ }
+