mirror of https://github.com/KLayout/klayout.git
Macro IDE: replace-and-find only replaces if current selection is matching search expression
This commit is contained in:
parent
4cb477a91d
commit
2337149eb5
|
|
@ -1135,7 +1135,11 @@ MacroEditorPage::replace_and_find_next (const QString &replace)
|
|||
|
||||
QTextCursor c = mp_text->textCursor ();
|
||||
if (c.hasSelection ()) {
|
||||
c.insertText (interpolate_string (replace, m_current_search));
|
||||
QTextBlock b = c.block ();
|
||||
int o = std::max (0, c.position () - b.position ());
|
||||
if (m_current_search.indexIn (b.text (), o) == o) {
|
||||
c.insertText (interpolate_string (replace, m_current_search));
|
||||
}
|
||||
}
|
||||
|
||||
find_next ();
|
||||
|
|
|
|||
Loading…
Reference in New Issue