diff --git a/NEWS.md b/NEWS.md index 53a345b4..1a30826c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +Red Panda C++ Version 0.13.3 + - enhancement: restore editor position after rename symbol + - enhancement: restore editor position after reformat code + Red Panda C++ Version 0.13.2 - fix: "delete and exit" button in the environtment / folder option page doesn't work correctly - fix: crash when closing the options dialog under Ubuntu 20.04 LTS ( no memory leak now) diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 647c7d05..2a1ab9c1 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -4636,7 +4636,13 @@ void MainWindow::on_actionReformat_Code_triggered() { Editor* e = mEditorList->getEditor(); if (e) { + BufferCoord oldXY=e->caretXY(); + int topLine = e->topLine(); + int leftChar = e->leftChar(); e->reformat(); + e->setTopLine(topLine); + e->setLeftChar(leftChar); + e->setCaretXY(oldXY); e->activate(); } } @@ -5479,7 +5485,13 @@ void MainWindow::on_actionRename_Symbol_triggered() //here we must reparse the file in sync, or rename may fail parser->parseFile(editor->filename(), editor->inProject(), false, false); CppRefacter refactor; + BufferCoord oldXY=editor->caretXY(); + int topLine = editor->topLine(); + int leftChar = editor->leftChar(); refactor.renameSymbol(editor,oldCaretXY,word,newWord); + editor->setTopLine(topLine); + editor->setLeftChar(leftChar); + editor->setCaretXY(oldXY); editor->reparse(); } diff --git a/Red_Panda_CPP.pro b/Red_Panda_CPP.pro index d3e299b2..58f033fb 100644 --- a/Red_Panda_CPP.pro +++ b/Red_Panda_CPP.pro @@ -7,7 +7,7 @@ SUBDIRS += \ APP_NAME = RedPandaCPP -APP_VERSION = 0.13.2 +APP_VERSION = 0.13.3 linux: {