- 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: Register names in the cpu info are not in correct order.
|
||||
- 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
|
||||
- enhancement: Code suggestion for embedded std::vectors.
|
||||
|
|
|
@ -841,7 +841,7 @@ void GDBMIDebuggerClient::processResultRecord(const QByteArray &line)
|
|||
QByteArray result = line.mid(pos+1);
|
||||
processResult(result);
|
||||
} else if (mCurrentCmd && !(mCurrentCmd->command.startsWith('-'))) {
|
||||
if (mCurrentCmd->command == "disas") {
|
||||
if (mCurrentCmd->command == "disas" && mCurrentCmd->source != DebugCommandSource::Console) {
|
||||
QStringList disOutput = mConsoleOutput;
|
||||
if (disOutput.length()>=3) {
|
||||
disOutput.pop_back();
|
||||
|
|
|
@ -4765,6 +4765,9 @@ void MainWindow::onDebugConsoleCopy()
|
|||
void MainWindow::onDebugConsoleClear()
|
||||
{
|
||||
ui->debugConsole->clear();
|
||||
if (pSettings->debugger().enableDebugConsole()) {
|
||||
ui->debugConsole->addLine("(gdb)");
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::onFilesViewOpenInExplorer()
|
||||
|
|
|
@ -158,6 +158,8 @@ QSynEdit::QSynEdit(QWidget *parent) : QAbstractScrollArea(parent),
|
|||
this, &QSynEdit::onScrolled);
|
||||
connect(verticalScrollBar(),&QScrollBar::valueChanged,
|
||||
this, &QSynEdit::onScrolled);
|
||||
connect(verticalScrollBar(), &QAbstractSlider::sliderReleased,
|
||||
this, qOverload<>(&QSynEdit::ensureLineAlignedWithTop));
|
||||
//enable input method
|
||||
setAttribute(Qt::WA_InputMethodEnabled);
|
||||
|
||||
|
@ -2877,6 +2879,31 @@ SyntaxState QSynEdit::calcSyntaxStateAtLine(int line, const QString &newLineText
|
|||
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
|
||||
{
|
||||
return viewport()->size().width();
|
||||
|
@ -2954,10 +2981,7 @@ void QSynEdit::ensureCaretVisibleEx(bool ForceToMiddle)
|
|||
if ((vCaretRow-1) * mTextHeight < mTopPos)
|
||||
setTopPos((vCaretRow - 1) * mTextHeight);
|
||||
else if (vCaretRow * mTextHeight > mTopPos + clientHeight() ) {
|
||||
int value = vCaretRow * mTextHeight - clientHeight();
|
||||
int offset = value % mTextHeight;
|
||||
if (offset!=0)
|
||||
value += (mTextHeight - offset);
|
||||
int value = calcLineAlignedTopPos(vCaretRow * mTextHeight - clientHeight(), true);
|
||||
setTopPos(value);
|
||||
} else
|
||||
setTopPos(mTopPos);
|
||||
|
@ -6029,7 +6053,6 @@ void QSynEdit::mousePressEvent(QMouseEvent *event)
|
|||
bool bStartDrag = false;
|
||||
mMouseMoved = false;
|
||||
mMouseOrigin = event->pos();
|
||||
mMouseScrollOldTop = topPos();
|
||||
Qt::MouseButton button = event->button();
|
||||
int X=event->pos().x();
|
||||
int Y=event->pos().y();
|
||||
|
@ -6108,11 +6131,7 @@ void QSynEdit::mouseReleaseEvent(QMouseEvent *event)
|
|||
mStateFlags.setFlag(StateFlag::sfWaitForDragging, false);
|
||||
}
|
||||
mStateFlags.setFlag(StateFlag::sfDblClicked,false);
|
||||
if (mTopPos != mMouseScrollOldTop) {
|
||||
int offset=mTopPos % mTextHeight;
|
||||
if (offset != 0)
|
||||
setTopPos(mTopPos - offset);
|
||||
}
|
||||
ensureLineAlignedWithTop();
|
||||
ensureCaretVisible();
|
||||
if (oldCaret!=caretXY()) {
|
||||
if (mOptions.testFlag(EditorOption::eoGroupUndo))
|
||||
|
@ -6304,14 +6323,8 @@ void QSynEdit::dropEvent(QDropEvent *event)
|
|||
&& coord>=mDragSelBeginSave && coord<=mDragSelEndSave)
|
||||
) {
|
||||
mDocument->deleteAt(mDocument->count()-1);
|
||||
int topPos = mTopPos;
|
||||
if (topPos!=mMouseScrollOldTop) {
|
||||
int offset = topPos % mTextHeight;
|
||||
if (offset!=0)
|
||||
topPos -= offset;
|
||||
setTopPos(topPos);
|
||||
ensureLineAlignedWithTop();
|
||||
ensureCaretVisible();
|
||||
}
|
||||
//do nothing if drag onto itself
|
||||
event->acceptProposedAction();
|
||||
mDropped = true;
|
||||
|
@ -6388,11 +6401,7 @@ void QSynEdit::dropEvent(QDropEvent *event)
|
|||
endEditing();
|
||||
event->acceptProposedAction();
|
||||
mDropped = true;
|
||||
if (topPos!=mMouseScrollOldTop) {
|
||||
int offset = topPos % mTextHeight;
|
||||
if (offset!=0)
|
||||
topPos -= offset;
|
||||
}
|
||||
topPos = calcLineAlignedTopPos(topPos, false);
|
||||
setTopPos(topPos);
|
||||
setLeftPos(leftPos);
|
||||
internalSetCaretXY(coord);
|
||||
|
|
|
@ -501,6 +501,8 @@ protected:
|
|||
void decPaintLock();
|
||||
SyntaxState calcSyntaxStateAtLine(int line, const QString &newLineText);
|
||||
private:
|
||||
int calcLineAlignedTopPos(int currentValue, bool passFirstLine);
|
||||
void ensureLineAlignedWithTop(void);
|
||||
BufferCoord ensureBufferCoordValid(const BufferCoord& coord);
|
||||
void beginEditingWithoutUndo();
|
||||
void endEditingWithoutUndo();
|
||||
|
@ -683,7 +685,6 @@ private:
|
|||
QFont mFontDummy;
|
||||
bool mMouseMoved;
|
||||
QPoint mMouseOrigin;
|
||||
int mMouseScrollOldTop;
|
||||
|
||||
bool mInserting;
|
||||
PDocument mDocument;
|
||||
|
|
Loading…
Reference in New Issue