mirror of https://github.com/vitalif/openscad
Editor: Fix bug where replaceAll could enter an infinite loop
parent
072c3a3059
commit
d3f736d873
|
@ -1166,9 +1166,14 @@ void MainWindow::replace() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::replaceAll() {
|
void MainWindow::replaceAll() {
|
||||||
while (findOperation()) {
|
QTextCursor old_cursor = editor->textCursor();
|
||||||
|
QTextCursor tmp_cursor = old_cursor;
|
||||||
|
tmp_cursor.movePosition(QTextCursor::Start);
|
||||||
|
editor->setTextCursor(tmp_cursor);
|
||||||
|
while (editor->find(findInputField->text())) {
|
||||||
editor->textCursor().insertText(replaceInputField->text());
|
editor->textCursor().insertText(replaceInputField->text());
|
||||||
}
|
}
|
||||||
|
editor->setTextCursor(old_cursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::findNext()
|
void MainWindow::findNext()
|
||||||
|
|
Loading…
Reference in New Issue