- enhancement: Restore line position after file is modified outside and reloaded.
This commit is contained in:
parent
e291a2e2fb
commit
8307f1b38f
1
NEWS.md
1
NEWS.md
|
@ -78,6 +78,7 @@ Red Panda C++ Version 2.27
|
||||||
- fix: History not correctly loaded with up/down arrow key in the debug console.
|
- fix: History not correctly loaded with up/down arrow key in the debug console.
|
||||||
- enhancement: Improve lambda support.
|
- enhancement: Improve lambda support.
|
||||||
- enhancement: Show type completion hint after "constexpr"/"extern"/"static"/"consteval"/"constinit"/"const"/"volatile" etc.
|
- enhancement: Show type completion hint after "constexpr"/"extern"/"static"/"consteval"/"constinit"/"const"/"volatile" etc.
|
||||||
|
- enhancement: Restore line position after file is modified outside and reloaded.
|
||||||
|
|
||||||
Red Panda C++ Version 2.26
|
Red Panda C++ Version 2.26
|
||||||
- enhancement: Code suggestion for embedded std::vectors.
|
- enhancement: Code suggestion for embedded std::vectors.
|
||||||
|
|
|
@ -5482,7 +5482,11 @@ void MainWindow::onFileChanged(const QString &path)
|
||||||
QMessageBox::Yes|QMessageBox::No,
|
QMessageBox::Yes|QMessageBox::No,
|
||||||
QMessageBox::No) == QMessageBox::Yes) {
|
QMessageBox::No) == QMessageBox::Yes) {
|
||||||
try {
|
try {
|
||||||
|
int topLine = e->topLine();
|
||||||
|
QSynedit::BufferCoord caretPos = e->caretXY();
|
||||||
e->loadFile();
|
e->loadFile();
|
||||||
|
e->setCaretPositionAndActivate(caretPos.line,1);
|
||||||
|
e->setTopLine(topLine);
|
||||||
} catch(FileError e) {
|
} catch(FileError e) {
|
||||||
QMessageBox::critical(this,tr("Error"),e.reason());
|
QMessageBox::critical(this,tr("Error"),e.reason());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue