- enhancement: restore caret position after batch replace

This commit is contained in:
Roy Qu 2022-06-10 22:08:10 +08:00
parent d01a60e88f
commit ef715b2c34
4 changed files with 10 additions and 1 deletions

View File

@ -3,6 +3,7 @@ Red Panda C++ Version 1.1.0
- enhancement: mark editor as modified, if the editing file is changed by other applications.
- enhancement: When the editing files is changed by other applications, only show one notification dialog for each file.
- fix: c files added to a project will be compiled as c++ file.
- enhancement: restore caret position after batch replace
Red Panda C++ Version 1.0.10
- fix: modify watch doesn't work

View File

@ -6489,8 +6489,14 @@ void MainWindow::on_btnReplace_clicked()
line.insert(item->start-1, newWord);
contents[item->line-1] = line;
}
BufferCoord coord=editor->caretXY();
int topLine = editor->topLine();
int leftChar = editor->leftChar();
editor->selectAll();
editor->setSelText(contents.join(editor->lineBreak()));
editor->setCaretXY(coord);
editor->setTopLine(topLine);
editor->setLeftChar(leftChar);
}
showSearchReplacePanel(false);
stretchMessagesPanel(false);

View File

@ -858,7 +858,7 @@
<enum>QTabWidget::South</enum>
</property>
<property name="currentIndex">
<number>6</number>
<number>3</number>
</property>
<property name="iconSize">
<size>

View File

@ -903,6 +903,8 @@ void Project::saveOptions()
ini.SetLongValue("Project","SupportXPThemes", mOptions.supportXPThemes);
ini.SetLongValue("Project","CompilerSet", mOptions.compilerSet);
ini.SetLongValue("Project","CompilerSetType", mOptions.compilerSetType);
ini.Delete("Project","CompilerSettings"); // remove old compiler settings
ini.Delete("CompilerSettings",nullptr); // remove old compiler settings
foreach (const QString& key, mOptions.compilerOptions.keys()) {
ini.SetValue("CompilerSettings",toByteArray(key),toByteArray(mOptions.compilerOptions.value(key)));
}