- enhancement: Display (gdb) prompt in debug console after it's cleared. - fix: Output of "disas" is not shown in debug console. enhancement: align first line top with editor window after vertical scrolled.
This commit is contained in:
parent
95cc1070ff
commit
5efc4ac279
4
NEWS.md
4
NEWS.md
|
@ -79,7 +79,9 @@ Red Panda C++ Version 2.27
|
||||||
- fix: Function name not correctly found if it and the '(' is not in one line;
|
- fix: Function name not correctly found if it and the '(' is not in one line;
|
||||||
- fix: Register names in the cpu info are not in correct order.
|
- fix: Register names in the cpu info are not in correct order.
|
||||||
- enhancement: Auto type induction for new / temp class object.
|
- enhancement: Auto type induction for new / temp class object.
|
||||||
- Enhancement: Vertically scroll by pixel.
|
- enhancement: Vertically scroll by pixel.
|
||||||
|
- enhancement: Display (gdb) prompt in debug console after it's cleared.
|
||||||
|
- fix: Output of "disas" is not shown in debug console.
|
||||||
|
|
||||||
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.
|
||||||
|
|
|
@ -841,7 +841,7 @@ void GDBMIDebuggerClient::processResultRecord(const QByteArray &line)
|
||||||
QByteArray result = line.mid(pos+1);
|
QByteArray result = line.mid(pos+1);
|
||||||
processResult(result);
|
processResult(result);
|
||||||
} else if (mCurrentCmd && !(mCurrentCmd->command.startsWith('-'))) {
|
} else if (mCurrentCmd && !(mCurrentCmd->command.startsWith('-'))) {
|
||||||
if (mCurrentCmd->command == "disas") {
|
if (mCurrentCmd->command == "disas" && mCurrentCmd->source != DebugCommandSource::Console) {
|
||||||
QStringList disOutput = mConsoleOutput;
|
QStringList disOutput = mConsoleOutput;
|
||||||
if (disOutput.length()>=3) {
|
if (disOutput.length()>=3) {
|
||||||
disOutput.pop_back();
|
disOutput.pop_back();
|
||||||
|
|
|
@ -2653,7 +2653,7 @@ void MainWindow::prepareDebugger()
|
||||||
// Clear logs
|
// Clear logs
|
||||||
ui->debugConsole->clear();
|
ui->debugConsole->clear();
|
||||||
if (pSettings->debugger().enableDebugConsole()) {
|
if (pSettings->debugger().enableDebugConsole()) {
|
||||||
ui->debugConsole->addLine("(gdb) ");
|
ui->debugConsole->addLine("(gdb)");
|
||||||
}
|
}
|
||||||
ui->txtEvalOutput->clear();
|
ui->txtEvalOutput->clear();
|
||||||
|
|
||||||
|
@ -4765,6 +4765,9 @@ void MainWindow::onDebugConsoleCopy()
|
||||||
void MainWindow::onDebugConsoleClear()
|
void MainWindow::onDebugConsoleClear()
|
||||||
{
|
{
|
||||||
ui->debugConsole->clear();
|
ui->debugConsole->clear();
|
||||||
|
if (pSettings->debugger().enableDebugConsole()) {
|
||||||
|
ui->debugConsole->addLine("(gdb)");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onFilesViewOpenInExplorer()
|
void MainWindow::onFilesViewOpenInExplorer()
|
||||||
|
|
|
@ -158,6 +158,8 @@ QSynEdit::QSynEdit(QWidget *parent) : QAbstractScrollArea(parent),
|
||||||
this, &QSynEdit::onScrolled);
|
this, &QSynEdit::onScrolled);
|
||||||
connect(verticalScrollBar(),&QScrollBar::valueChanged,
|
connect(verticalScrollBar(),&QScrollBar::valueChanged,
|
||||||
this, &QSynEdit::onScrolled);
|
this, &QSynEdit::onScrolled);
|
||||||
|
connect(verticalScrollBar(), &QAbstractSlider::sliderReleased,
|
||||||
|
this, qOverload<>(&QSynEdit::ensureLineAlignedWithTop));
|
||||||
//enable input method
|
//enable input method
|
||||||
setAttribute(Qt::WA_InputMethodEnabled);
|
setAttribute(Qt::WA_InputMethodEnabled);
|
||||||
|
|
||||||
|
@ -2877,6 +2879,31 @@ SyntaxState QSynEdit::calcSyntaxStateAtLine(int line, const QString &newLineText
|
||||||
return syntaxer()->getState();
|
return syntaxer()->getState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int QSynEdit::calcLineAlignedTopPos(int currentValue, bool passFirstLine)
|
||||||
|
{
|
||||||
|
int offset = currentValue % mTextHeight;
|
||||||
|
if (offset!=0) {
|
||||||
|
if (passFirstLine)
|
||||||
|
currentValue += (mTextHeight - offset);
|
||||||
|
else
|
||||||
|
currentValue -= offset;
|
||||||
|
}
|
||||||
|
return currentValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QSynEdit::ensureLineAlignedWithTop(void)
|
||||||
|
{
|
||||||
|
int value = mTopPos;
|
||||||
|
int offset = value % mTextHeight;
|
||||||
|
if (offset!=0) {
|
||||||
|
if (offset < mTextHeight / 3)
|
||||||
|
value -= offset;
|
||||||
|
else
|
||||||
|
value += (mTextHeight - offset);
|
||||||
|
}
|
||||||
|
setTopPos(value);
|
||||||
|
}
|
||||||
|
|
||||||
int QSynEdit::clientWidth() const
|
int QSynEdit::clientWidth() const
|
||||||
{
|
{
|
||||||
return viewport()->size().width();
|
return viewport()->size().width();
|
||||||
|
@ -2952,12 +2979,9 @@ void QSynEdit::ensureCaretVisibleEx(bool ForceToMiddle)
|
||||||
setTopPos( (vCaretRow - (mLinesInWindow - 1) / 2-1) * mTextHeight);
|
setTopPos( (vCaretRow - (mLinesInWindow - 1) / 2-1) * mTextHeight);
|
||||||
} else {
|
} else {
|
||||||
if ((vCaretRow-1) * mTextHeight < mTopPos)
|
if ((vCaretRow-1) * mTextHeight < mTopPos)
|
||||||
setTopPos( (vCaretRow - 1) * mTextHeight);
|
setTopPos((vCaretRow - 1) * mTextHeight);
|
||||||
else if (vCaretRow * mTextHeight > mTopPos + clientHeight() ) {
|
else if (vCaretRow * mTextHeight > mTopPos + clientHeight() ) {
|
||||||
int value = vCaretRow * mTextHeight - clientHeight();
|
int value = calcLineAlignedTopPos(vCaretRow * mTextHeight - clientHeight(), true);
|
||||||
int offset = value % mTextHeight;
|
|
||||||
if (offset!=0)
|
|
||||||
value += (mTextHeight - offset);
|
|
||||||
setTopPos(value);
|
setTopPos(value);
|
||||||
} else
|
} else
|
||||||
setTopPos(mTopPos);
|
setTopPos(mTopPos);
|
||||||
|
@ -6029,7 +6053,6 @@ void QSynEdit::mousePressEvent(QMouseEvent *event)
|
||||||
bool bStartDrag = false;
|
bool bStartDrag = false;
|
||||||
mMouseMoved = false;
|
mMouseMoved = false;
|
||||||
mMouseOrigin = event->pos();
|
mMouseOrigin = event->pos();
|
||||||
mMouseScrollOldTop = topPos();
|
|
||||||
Qt::MouseButton button = event->button();
|
Qt::MouseButton button = event->button();
|
||||||
int X=event->pos().x();
|
int X=event->pos().x();
|
||||||
int Y=event->pos().y();
|
int Y=event->pos().y();
|
||||||
|
@ -6108,11 +6131,7 @@ void QSynEdit::mouseReleaseEvent(QMouseEvent *event)
|
||||||
mStateFlags.setFlag(StateFlag::sfWaitForDragging, false);
|
mStateFlags.setFlag(StateFlag::sfWaitForDragging, false);
|
||||||
}
|
}
|
||||||
mStateFlags.setFlag(StateFlag::sfDblClicked,false);
|
mStateFlags.setFlag(StateFlag::sfDblClicked,false);
|
||||||
if (mTopPos != mMouseScrollOldTop) {
|
ensureLineAlignedWithTop();
|
||||||
int offset=mTopPos % mTextHeight;
|
|
||||||
if (offset != 0)
|
|
||||||
setTopPos(mTopPos - offset);
|
|
||||||
}
|
|
||||||
ensureCaretVisible();
|
ensureCaretVisible();
|
||||||
if (oldCaret!=caretXY()) {
|
if (oldCaret!=caretXY()) {
|
||||||
if (mOptions.testFlag(EditorOption::eoGroupUndo))
|
if (mOptions.testFlag(EditorOption::eoGroupUndo))
|
||||||
|
@ -6304,14 +6323,8 @@ void QSynEdit::dropEvent(QDropEvent *event)
|
||||||
&& coord>=mDragSelBeginSave && coord<=mDragSelEndSave)
|
&& coord>=mDragSelBeginSave && coord<=mDragSelEndSave)
|
||||||
) {
|
) {
|
||||||
mDocument->deleteAt(mDocument->count()-1);
|
mDocument->deleteAt(mDocument->count()-1);
|
||||||
int topPos = mTopPos;
|
ensureLineAlignedWithTop();
|
||||||
if (topPos!=mMouseScrollOldTop) {
|
ensureCaretVisible();
|
||||||
int offset = topPos % mTextHeight;
|
|
||||||
if (offset!=0)
|
|
||||||
topPos -= offset;
|
|
||||||
setTopPos(topPos);
|
|
||||||
ensureCaretVisible();
|
|
||||||
}
|
|
||||||
//do nothing if drag onto itself
|
//do nothing if drag onto itself
|
||||||
event->acceptProposedAction();
|
event->acceptProposedAction();
|
||||||
mDropped = true;
|
mDropped = true;
|
||||||
|
@ -6388,11 +6401,7 @@ void QSynEdit::dropEvent(QDropEvent *event)
|
||||||
endEditing();
|
endEditing();
|
||||||
event->acceptProposedAction();
|
event->acceptProposedAction();
|
||||||
mDropped = true;
|
mDropped = true;
|
||||||
if (topPos!=mMouseScrollOldTop) {
|
topPos = calcLineAlignedTopPos(topPos, false);
|
||||||
int offset = topPos % mTextHeight;
|
|
||||||
if (offset!=0)
|
|
||||||
topPos -= offset;
|
|
||||||
}
|
|
||||||
setTopPos(topPos);
|
setTopPos(topPos);
|
||||||
setLeftPos(leftPos);
|
setLeftPos(leftPos);
|
||||||
internalSetCaretXY(coord);
|
internalSetCaretXY(coord);
|
||||||
|
|
|
@ -501,6 +501,8 @@ protected:
|
||||||
void decPaintLock();
|
void decPaintLock();
|
||||||
SyntaxState calcSyntaxStateAtLine(int line, const QString &newLineText);
|
SyntaxState calcSyntaxStateAtLine(int line, const QString &newLineText);
|
||||||
private:
|
private:
|
||||||
|
int calcLineAlignedTopPos(int currentValue, bool passFirstLine);
|
||||||
|
void ensureLineAlignedWithTop(void);
|
||||||
BufferCoord ensureBufferCoordValid(const BufferCoord& coord);
|
BufferCoord ensureBufferCoordValid(const BufferCoord& coord);
|
||||||
void beginEditingWithoutUndo();
|
void beginEditingWithoutUndo();
|
||||||
void endEditingWithoutUndo();
|
void endEditingWithoutUndo();
|
||||||
|
@ -683,7 +685,6 @@ private:
|
||||||
QFont mFontDummy;
|
QFont mFontDummy;
|
||||||
bool mMouseMoved;
|
bool mMouseMoved;
|
||||||
QPoint mMouseOrigin;
|
QPoint mMouseOrigin;
|
||||||
int mMouseScrollOldTop;
|
|
||||||
|
|
||||||
bool mInserting;
|
bool mInserting;
|
||||||
PDocument mDocument;
|
PDocument mDocument;
|
||||||
|
|
Loading…
Reference in New Issue