# After replacing with something that matches the search pattern, the next
# match should not consider the just replaced text (#4388)
#
+Lang it_IT.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: aaa\[Home]
KK: \CF
# Basic test on refactoring of mathematics notation
#
+Lang it_IT.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: \Cm
KK: x^(a) +\\frac 1+x^(a) \[Down]1-x^(a) \C\[Home]
--- /dev/null
+#
+Lang it_IT.utf8
+TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
+KK: \Cm
+KK: x^2 -x^2\C\[Home]
+KK: \Afs
+KK: \CF
+KK: \Cm
+KK: x^2\[Return]
+TestEnd pcregrep -M "Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 0" lyx-log.txt
+TestBegin test2.lyx -dbg find > lyx-log2.txt 2>&1
+KK: \Cm
+KK: x^2 -x^2\C\[Home]
+KK: \Afs
+KK: \CF
+KK: \Cm
+KK: x^2\[Return]\[Return]
+TestEnd
+Assert pcregrep -M "Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 2" lyx-log2.txt
--- /dev/null
+# Regression test for #7245
+#
+Lang it_IT.utf8
+TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
+KK: \Cm
+KK: x^2\C\[Home]
+KK: \CF
+KK: \Cm
+KK: x^2\[Tab]
+KK: \Cm
+KK: x^2n\[Return]\[Return]\[Escape]
+KK: \Afs
+KK: \Ax
+KK: buffer-export latex\[Return]
+TestEnd grep '^\$x\^{2n}\$$' test.tex