make Ctrl+f in ktxt2 case-insensitive

This commit is contained in:
2021-12-17 12:42:58 -07:00
parent 12a9d1f260
commit 4455ca9538

View File

@@ -456,12 +456,11 @@
(defMacro __find []
`(let [elem (nth ktxt2Elements idx)]
(assertLet [(Block block) elem]
(whenLet [(Some foundIdx) (indexOf "${block.source}${block.output}" text)]
(whenLet [(Some foundIdx) (indexOf (.toLowerCase "${block.source}${block.output}") (.toLowerCase text))]
(changeElementScrollY ->(set elementScrollY idx))
(return)))))
(function :Void _find [text]
// TODO use (indexOf) to find the text in source/output of elements, then set elementScrollY to that element
(let [startIdx elementScrollY]
(doFor idx (range (+ 1 startIdx) ktxt2Elements.length)
(__find))