- enhancement: add select current word command in the Selection menu
- change: add Selection menu - enhancement: add memory view rows/columns settings in the settings dialog -> debugger -> general panel - enhancement: add "Go to Line..." in the Code menu
This commit is contained in:
parent
f20d5f1b07
commit
17eb0c1f94
4
NEWS.md
4
NEWS.md
|
@ -5,6 +5,10 @@ Red Panda C++ Version 1.1.5
|
|||
- enhancement: double clicking a non-text file in the project's view, will open it with external program
|
||||
- fix: correctly update the start postion of selection after code completion
|
||||
- enhancement: add a demo template for raylib/rdrawing predefined colors
|
||||
- enhancement: add select current word command in the Selection menu
|
||||
- change: add Selection menu
|
||||
- enhancement: add memory view rows/columns settings in the settings dialog -> debugger -> general panel
|
||||
- enhancement: add "Go to Line..." in the Code menu
|
||||
|
||||
Red Panda C++ Version 1.1.4
|
||||
|
||||
|
|
|
@ -784,6 +784,18 @@
|
|||
<source>Show disassembly code in blend mode</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Memory View</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Memory View Rows</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Memory View Columns</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Debugger</name>
|
||||
|
@ -4496,6 +4508,26 @@
|
|||
<source>untitled%1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Selection</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select Word</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Go to Line...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Go to Line</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Line</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>NewClassDialog</name>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -784,6 +784,18 @@
|
|||
<source>Show disassembly code in blend mode</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Memory View</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Memory View Rows</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Memory View Columns</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Debugger</name>
|
||||
|
@ -4496,6 +4508,26 @@
|
|||
<source>untitled%1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Selection</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Select Word</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Go to Line...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Go to Line</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Line</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>NewClassDialog</name>
|
||||
|
|
|
@ -267,3 +267,17 @@ bool GCCCompilerInfo::forceUTF8InDebugger()
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
GCCUTF8CompilerInfo::GCCUTF8CompilerInfo():CompilerInfo(COMPILER_GCC_UTF8)
|
||||
{
|
||||
}
|
||||
|
||||
bool GCCUTF8CompilerInfo::supportConvertingCharset()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GCCUTF8CompilerInfo::forceUTF8InDebugger()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <QMutex>
|
||||
#define COMPILER_CLANG "Clang"
|
||||
#define COMPILER_GCC "GCC"
|
||||
#define COMPILER_GCC_UTF8 "GCC_UTF8"
|
||||
|
||||
#define CC_CMD_OPT_ANSI "cc_cmd_opt_ansi"
|
||||
#define CC_CMD_OPT_NO_ASM "cc_cmd_opt_no_asm"
|
||||
|
@ -122,6 +123,13 @@ public:
|
|||
bool forceUTF8InDebugger() override;
|
||||
};
|
||||
|
||||
class GCCUTF8CompilerInfo: public CompilerInfo{
|
||||
public:
|
||||
GCCUTF8CompilerInfo();
|
||||
bool supportConvertingCharset() override;
|
||||
bool forceUTF8InDebugger() override;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // COMPILERINFO_H
|
||||
|
|
|
@ -235,7 +235,11 @@ void Debugger::refreshAll()
|
|||
refreshWatchVars();
|
||||
sendCommand("-stack-list-variables", "--all-values");
|
||||
if (memoryModel()->startAddress()>0)
|
||||
sendCommand("-data-read-memory",QString("%1 x 1 8 8 ").arg(memoryModel()->startAddress()));
|
||||
sendCommand("-data-read-memory",QString("%1 x 1 %2 %3 ")
|
||||
.arg(memoryModel()->startAddress())
|
||||
.arg(pSettings->debugger().memoryViewRows())
|
||||
.arg(pSettings->debugger().memoryViewColumns())
|
||||
);
|
||||
}
|
||||
|
||||
RegisterModel *Debugger::registerModel() const
|
||||
|
@ -2509,6 +2513,7 @@ MemoryModel::MemoryModel(int dataPerLine, QObject *parent):
|
|||
|
||||
void MemoryModel::updateMemory(const QStringList &value)
|
||||
{
|
||||
int maxDataPerLine=-1;
|
||||
QRegExp delimiter("(\\s+)");
|
||||
QList<PMemoryLine> newModel;
|
||||
for (int i=0;i<value.length();i++) {
|
||||
|
@ -2524,6 +2529,8 @@ void MemoryModel::updateMemory(const QStringList &value)
|
|||
bool isOk;
|
||||
memoryLine->startAddress = stringToHex(dataLst[0],isOk);
|
||||
if (isOk) {
|
||||
if (dataLst.length()-1>maxDataPerLine)
|
||||
maxDataPerLine = dataLst.length()-1;
|
||||
for (int j=1;j<dataLst.length();j++) {
|
||||
qulonglong data = stringToHex(dataLst[j],isOk);
|
||||
if (isOk)
|
||||
|
@ -2539,7 +2546,8 @@ void MemoryModel::updateMemory(const QStringList &value)
|
|||
newModel.append(memoryLine);
|
||||
}
|
||||
if (newModel.count()>0 && newModel.count()== mLines.count() &&
|
||||
newModel[0]->startAddress == mLines[0]->startAddress) {
|
||||
newModel[0]->startAddress == mLines[0]->startAddress &&
|
||||
maxDataPerLine==mDataPerLine) {
|
||||
for (int i=0;i<newModel.count();i++) {
|
||||
PMemoryLine newLine = newModel[i];
|
||||
PMemoryLine oldLine = mLines[i];
|
||||
|
@ -2555,6 +2563,8 @@ void MemoryModel::updateMemory(const QStringList &value)
|
|||
createIndex(mLines.count()-1,mDataPerLine-1));
|
||||
} else {
|
||||
beginResetModel();
|
||||
if (maxDataPerLine>0)
|
||||
mDataPerLine=maxDataPerLine;
|
||||
mLines = newModel;
|
||||
endResetModel();
|
||||
}
|
||||
|
|
|
@ -454,6 +454,7 @@ void MainWindow::updateEditorActions()
|
|||
ui->actionRemove_Bookmark->setEnabled(false);
|
||||
ui->actionModify_Bookmark_Description->setEnabled(false);
|
||||
|
||||
ui->actionGo_to_Line->setEnabled(false);
|
||||
ui->actionLocate_in_Files_View->setEnabled(false);
|
||||
} else {
|
||||
ui->actionAuto_Detect->setEnabled(true);
|
||||
|
@ -505,6 +506,7 @@ void MainWindow::updateEditorActions()
|
|||
ui->actionRemove_Bookmark->setEnabled(e->hasBookmark(line));
|
||||
ui->actionModify_Bookmark_Description->setEnabled(e->hasBookmark(line));
|
||||
|
||||
ui->actionGo_to_Line->setEnabled(true);
|
||||
ui->actionLocate_in_Files_View->setEnabled(!e->isNew());
|
||||
}
|
||||
|
||||
|
@ -4040,6 +4042,8 @@ void MainWindow::onEditorContextMenu(const QPoint& pos)
|
|||
menu.addAction(ui->actionRemove_Bookmark);
|
||||
menu.addAction(ui->actionModify_Bookmark_Description);
|
||||
menu.addSeparator();
|
||||
menu.addAction(ui->actionGo_to_Line);
|
||||
menu.addSeparator();
|
||||
menu.addAction(ui->actionFile_Properties);
|
||||
|
||||
//these actions needs parser
|
||||
|
@ -4058,6 +4062,8 @@ void MainWindow::onEditorContextMenu(const QPoint& pos)
|
|||
menu.addAction(ui->actionAdd_bookmark);
|
||||
menu.addAction(ui->actionRemove_Bookmark);
|
||||
menu.addAction(ui->actionModify_Bookmark_Description);
|
||||
menu.addSeparator();
|
||||
menu.addAction(ui->actionGo_to_Line);
|
||||
}
|
||||
ui->actionLocate_in_Files_View->setEnabled(!editor->isNew());
|
||||
ui->actionBreakpoint_property->setEnabled(editor->hasBreakpoint(line));
|
||||
|
@ -5227,7 +5233,11 @@ void MainWindow::onDebugMemoryAddressInput()
|
|||
if (!s.isEmpty()) {
|
||||
// connect(mDebugger, &Debugger::memoryExamineReady,
|
||||
// this, &MainWindow::onMemoryExamineReady);
|
||||
mDebugger->sendCommand("-data-read-memory",QString("%1 x 1 8 8 ").arg(s));
|
||||
mDebugger->sendCommand("-data-read-memory",QString("%1 x 1 %2 %3 ")
|
||||
.arg(s)
|
||||
.arg(pSettings->debugger().memoryViewRows())
|
||||
.arg(pSettings->debugger().memoryViewColumns())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8015,3 +8025,28 @@ void MainWindow::on_actionRaylib_Manual_triggered()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionSelect_Word_triggered()
|
||||
{
|
||||
Editor* e=mEditorList->getEditor();
|
||||
if (e) {
|
||||
e->selectWord();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionGo_to_Line_triggered()
|
||||
{
|
||||
Editor* e=mEditorList->getEditor();
|
||||
if (!e)
|
||||
return;
|
||||
bool ok;
|
||||
int lineNo=QInputDialog::getInt(e,tr("Go to Line"),tr("Line"),
|
||||
e->caretY(),1,e->document()->count(),
|
||||
1,&ok);
|
||||
if (ok && lineNo!=e->caretY()) {
|
||||
e->setCaretPosition(lineNo,1);
|
||||
e->setFocus();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -695,6 +695,10 @@ private slots:
|
|||
|
||||
void on_actionRaylib_Manual_triggered();
|
||||
|
||||
void on_actionSelect_Word_triggered();
|
||||
|
||||
void on_actionGo_to_Line_triggered();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
EditorList *mEditorList;
|
||||
|
|
|
@ -182,7 +182,6 @@
|
|||
<addaction name="actionCut"/>
|
||||
<addaction name="actionCopy"/>
|
||||
<addaction name="actionPaste"/>
|
||||
<addaction name="actionSelectAll"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionIndent"/>
|
||||
<addaction name="actionUnIndent"/>
|
||||
|
@ -193,8 +192,6 @@
|
|||
<addaction name="actionFoldAll"/>
|
||||
<addaction name="actionUnfoldAll"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionMove_Selection_Up"/>
|
||||
<addaction name="actionMove_Selection_Down"/>
|
||||
<addaction name="actionDelete_Line"/>
|
||||
<addaction name="actionDuplicate_Line"/>
|
||||
<addaction name="actionDelete_Word"/>
|
||||
|
@ -223,6 +220,7 @@
|
|||
<addaction name="actionForward"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionMatch_Bracket"/>
|
||||
<addaction name="actionGo_to_Line"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionAdd_bookmark"/>
|
||||
<addaction name="actionRemove_Bookmark"/>
|
||||
|
@ -323,8 +321,19 @@
|
|||
<addaction name="actionGit_Commit"/>
|
||||
<addaction name="actionGit_Restore"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuSelection">
|
||||
<property name="title">
|
||||
<string>Selection</string>
|
||||
</property>
|
||||
<addaction name="actionSelectAll"/>
|
||||
<addaction name="actionSelect_Word"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionMove_Selection_Up"/>
|
||||
<addaction name="actionMove_Selection_Down"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuEdit"/>
|
||||
<addaction name="menuSelection"/>
|
||||
<addaction name="menuView"/>
|
||||
<addaction name="menuSearch"/>
|
||||
<addaction name="menuCode"/>
|
||||
|
@ -3168,6 +3177,16 @@
|
|||
<string>Raylib Manual</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSelect_Word">
|
||||
<property name="text">
|
||||
<string>Select Word</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionGo_to_Line">
|
||||
<property name="text">
|
||||
<string>Go to Line...</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
|
|
@ -189,15 +189,16 @@ void SynEditKeyStrokes::resetDefaults()
|
|||
add(SynEditorCommand::ecScrollDown, Qt::Key_Down, Qt::ControlModifier);
|
||||
add(SynEditorCommand::ecLeft, Qt::Key_Left, Qt::NoModifier);
|
||||
add(SynEditorCommand::ecSelLeft, Qt::Key_Left, Qt::ShiftModifier);
|
||||
add(SynEditorCommand::ecSelLeft, Qt::Key_Left, Qt::ShiftModifier | Qt::AltModifier);
|
||||
add(SynEditorCommand::ecWordLeft, Qt::Key_Left, Qt::ControlModifier);
|
||||
add(SynEditorCommand::ecSelWordLeft, Qt::Key_Left, Qt::ShiftModifier|Qt::ControlModifier);
|
||||
add(SynEditorCommand::ecRight, Qt::Key_Right, Qt::NoModifier);
|
||||
add(SynEditorCommand::ecSelRight, Qt::Key_Right, Qt::ShiftModifier);
|
||||
add(SynEditorCommand::ecSelRight, Qt::Key_Right, Qt::ShiftModifier | Qt::AltModifier);
|
||||
add(SynEditorCommand::ecWordRight, Qt::Key_Right, Qt::ControlModifier);
|
||||
add(SynEditorCommand::ecSelWordRight, Qt::Key_Right, Qt::ShiftModifier|Qt::ControlModifier);
|
||||
|
||||
// add(SynEditorCommand::ecExpandSelection, Qt::Key_Right, Qt::ShiftModifier|Qt::AltModifier);
|
||||
// add(SynEditorCommand::ecShrinkSelection, Qt::Key_Left, Qt::ShiftModifier | Qt::AltModifier);
|
||||
|
||||
add(SynEditorCommand::ecPageDown, Qt::Key_PageDown, Qt::NoModifier);
|
||||
add(SynEditorCommand::ecSelPageDown, Qt::Key_PageDown, Qt::ShiftModifier);
|
||||
add(SynEditorCommand::ecPageBottom, Qt::Key_PageDown, Qt::ControlModifier);
|
||||
|
|
|
@ -91,6 +91,8 @@ enum class SynEditorCommand {
|
|||
ecCopy = 201, // Copy selection to clipboard
|
||||
ecSelWord = 202,
|
||||
ecSelectAll = 203, // Select entire contents of editor, cursor to end
|
||||
ecExpandSelection = 204, // expand selection
|
||||
ecShrinkSelection = 205, // shrink selection
|
||||
|
||||
ecScrollUp = 211, // Scroll up one line leaving cursor position unchanged.
|
||||
ecScrollDown = 212, // Scroll down one line leaving cursor position unchanged.
|
||||
|
|
|
@ -367,84 +367,84 @@ int SynEdit::maxScrollWidth() const
|
|||
return std::max(maxLen-mCharsInWindow+1, 1);
|
||||
}
|
||||
|
||||
bool SynEdit::getHighlighterAttriAtRowCol(const BufferCoord &XY, QString &Token, PSynHighlighterAttribute &Attri)
|
||||
bool SynEdit::getHighlighterAttriAtRowCol(const BufferCoord &pos, QString &token, PSynHighlighterAttribute &attri)
|
||||
{
|
||||
SynHighlighterTokenType TmpType;
|
||||
int TmpKind, TmpStart;
|
||||
return getHighlighterAttriAtRowColEx(XY, Token, TmpType, TmpKind,TmpStart, Attri);
|
||||
SynHighlighterTokenType tmpType;
|
||||
int tmpKind, tmpStart;
|
||||
return getHighlighterAttriAtRowColEx(pos, token, tmpType, tmpKind,tmpStart, attri);
|
||||
}
|
||||
|
||||
bool SynEdit::getHighlighterAttriAtRowCol(const BufferCoord &XY, QString &Token, bool &tokenFinished, SynHighlighterTokenType &TokenType, PSynHighlighterAttribute &Attri)
|
||||
bool SynEdit::getHighlighterAttriAtRowCol(const BufferCoord &pos, QString &token, bool &tokenFinished, SynHighlighterTokenType &tokenType, PSynHighlighterAttribute &attri)
|
||||
{
|
||||
int PosX, PosY, endPos, Start;
|
||||
QString Line;
|
||||
PosY = XY.line - 1;
|
||||
if (mHighlighter && (PosY >= 0) && (PosY < mDocument->count())) {
|
||||
Line = mDocument->getString(PosY);
|
||||
if (PosY == 0) {
|
||||
int posX, posY, endPos, start;
|
||||
QString line;
|
||||
posY = pos.line - 1;
|
||||
if (mHighlighter && (posY >= 0) && (posY < mDocument->count())) {
|
||||
line = mDocument->getString(posY);
|
||||
if (posY == 0) {
|
||||
mHighlighter->resetState();
|
||||
} else {
|
||||
mHighlighter->setState(mDocument->ranges(PosY-1));
|
||||
mHighlighter->setState(mDocument->ranges(posY-1));
|
||||
}
|
||||
mHighlighter->setLine(Line, PosY);
|
||||
PosX = XY.ch;
|
||||
if ((PosX > 0) && (PosX <= Line.length())) {
|
||||
mHighlighter->setLine(line, posY);
|
||||
posX = pos.ch;
|
||||
if ((posX > 0) && (posX <= line.length())) {
|
||||
while (!mHighlighter->eol()) {
|
||||
Start = mHighlighter->getTokenPos() + 1;
|
||||
Token = mHighlighter->getToken();
|
||||
endPos = Start + Token.length()-1;
|
||||
if ((PosX >= Start) && (PosX <= endPos)) {
|
||||
Attri = mHighlighter->getTokenAttribute();
|
||||
if (PosX == endPos)
|
||||
start = mHighlighter->getTokenPos() + 1;
|
||||
token = mHighlighter->getToken();
|
||||
endPos = start + token.length()-1;
|
||||
if ((posX >= start) && (posX <= endPos)) {
|
||||
attri = mHighlighter->getTokenAttribute();
|
||||
if (posX == endPos)
|
||||
tokenFinished = mHighlighter->getTokenFinished();
|
||||
else
|
||||
tokenFinished = false;
|
||||
TokenType = mHighlighter->getTokenType();
|
||||
tokenType = mHighlighter->getTokenType();
|
||||
return true;
|
||||
}
|
||||
mHighlighter->next();
|
||||
}
|
||||
}
|
||||
}
|
||||
Token = "";
|
||||
Attri = PSynHighlighterAttribute();
|
||||
token = "";
|
||||
attri = PSynHighlighterAttribute();
|
||||
tokenFinished = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SynEdit::getHighlighterAttriAtRowColEx(const BufferCoord &XY, QString &Token, SynHighlighterTokenType &TokenType, SynTokenKind &TokenKind, int &Start, PSynHighlighterAttribute &Attri)
|
||||
bool SynEdit::getHighlighterAttriAtRowColEx(const BufferCoord &pos, QString &token, SynHighlighterTokenType &tokenType, SynTokenKind &tokenKind, int &start, PSynHighlighterAttribute &attri)
|
||||
{
|
||||
int PosX, PosY, endPos;
|
||||
QString Line;
|
||||
PosY = XY.line - 1;
|
||||
if (mHighlighter && (PosY >= 0) && (PosY < mDocument->count())) {
|
||||
Line = mDocument->getString(PosY);
|
||||
if (PosY == 0) {
|
||||
int posX, posY, endPos;
|
||||
QString line;
|
||||
posY = pos.line - 1;
|
||||
if (mHighlighter && (posY >= 0) && (posY < mDocument->count())) {
|
||||
line = mDocument->getString(posY);
|
||||
if (posY == 0) {
|
||||
mHighlighter->resetState();
|
||||
} else {
|
||||
mHighlighter->setState(mDocument->ranges(PosY-1));
|
||||
mHighlighter->setState(mDocument->ranges(posY-1));
|
||||
}
|
||||
mHighlighter->setLine(Line, PosY);
|
||||
PosX = XY.ch;
|
||||
if ((PosX > 0) && (PosX <= Line.length())) {
|
||||
mHighlighter->setLine(line, posY);
|
||||
posX = pos.ch;
|
||||
if ((posX > 0) && (posX <= line.length())) {
|
||||
while (!mHighlighter->eol()) {
|
||||
Start = mHighlighter->getTokenPos() + 1;
|
||||
Token = mHighlighter->getToken();
|
||||
endPos = Start + Token.length()-1;
|
||||
if ((PosX >= Start) && (PosX <= endPos)) {
|
||||
Attri = mHighlighter->getTokenAttribute();
|
||||
TokenKind = mHighlighter->getTokenKind();
|
||||
TokenType = mHighlighter->getTokenType();
|
||||
start = mHighlighter->getTokenPos() + 1;
|
||||
token = mHighlighter->getToken();
|
||||
endPos = start + token.length()-1;
|
||||
if ((posX >= start) && (posX <= endPos)) {
|
||||
attri = mHighlighter->getTokenAttribute();
|
||||
tokenKind = mHighlighter->getTokenKind();
|
||||
tokenType = mHighlighter->getTokenType();
|
||||
return true;
|
||||
}
|
||||
mHighlighter->next();
|
||||
}
|
||||
}
|
||||
}
|
||||
Token = "";
|
||||
Attri = PSynHighlighterAttribute();
|
||||
TokenKind = 0;
|
||||
TokenType = SynHighlighterTokenType::Default;
|
||||
token = "";
|
||||
attri = PSynHighlighterAttribute();
|
||||
tokenKind = 0;
|
||||
tokenType = SynHighlighterTokenType::Default;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1514,24 +1514,38 @@ void SynEdit::setSelWord()
|
|||
setWordBlock(caretXY());
|
||||
}
|
||||
|
||||
void SynEdit::setWordBlock(BufferCoord Value)
|
||||
void SynEdit::setWordBlock(BufferCoord value)
|
||||
{
|
||||
// if (mOptions.testFlag(eoScrollPastEol))
|
||||
// Value.Char =
|
||||
// else
|
||||
// Value.Char = std::max(Value.Char, 1);
|
||||
Value.line = minMax(Value.line, 1, mDocument->count());
|
||||
Value.ch = std::max(Value.ch, 1);
|
||||
QString TempString = mDocument->getString(Value.line - 1); //needed for CaretX = LineLength +1
|
||||
if (Value.ch > TempString.length()) {
|
||||
internalSetCaretXY(BufferCoord{TempString.length()+1, Value.line});
|
||||
value.line = minMax(value.line, 1, mDocument->count());
|
||||
value.ch = std::max(value.ch, 1);
|
||||
QString TempString = mDocument->getString(value.line - 1); //needed for CaretX = LineLength +1
|
||||
if (value.ch > TempString.length()) {
|
||||
internalSetCaretXY(BufferCoord{TempString.length()+1, value.line});
|
||||
return;
|
||||
}
|
||||
|
||||
BufferCoord v_WordStart = wordStartEx(Value);
|
||||
BufferCoord v_WordEnd = wordEndEx(Value);
|
||||
if ((v_WordStart.line == v_WordEnd.line) && (v_WordStart.ch < v_WordEnd.ch))
|
||||
setCaretAndSelection(v_WordEnd, v_WordStart, v_WordEnd);
|
||||
BufferCoord vWordStart = wordStartEx(value);
|
||||
BufferCoord vWordEnd = wordEndEx(value);
|
||||
if ((vWordStart.line == vWordEnd.line) && (vWordStart.ch < vWordEnd.ch))
|
||||
setCaretAndSelection(vWordEnd, vWordStart, vWordEnd);
|
||||
}
|
||||
|
||||
void SynEdit::doExpandSelection(const BufferCoord &pos)
|
||||
{
|
||||
if (selAvail()) {
|
||||
//todo
|
||||
} else {
|
||||
setWordBlock(pos);
|
||||
}
|
||||
}
|
||||
|
||||
void SynEdit::doShrinkSelection(const BufferCoord &pos)
|
||||
{
|
||||
//todo
|
||||
}
|
||||
|
||||
int SynEdit::findCommentStartLine(int searchStartLine)
|
||||
|
@ -5834,6 +5848,12 @@ void SynEdit::ExecuteCommand(SynEditorCommand Command, QChar AChar, void *pData)
|
|||
case SynEditorCommand::ecSelectAll:
|
||||
doSelectAll();
|
||||
break;
|
||||
case SynEditorCommand::ecExpandSelection:
|
||||
doExpandSelection(caretXY());
|
||||
break;
|
||||
case SynEditorCommand::ecShrinkSelection:
|
||||
doShrinkSelection(caretXY());
|
||||
break;
|
||||
case SynEditorCommand::ecDeleteLastChar:
|
||||
doDeleteLastChar();
|
||||
break;
|
||||
|
@ -6332,7 +6352,7 @@ void SynEdit::mouseDoubleClickEvent(QMouseEvent *event)
|
|||
QAbstractScrollArea::mouseDoubleClickEvent(event);
|
||||
QPoint ptMouse = event->pos();
|
||||
if (ptMouse.x() >= mGutterWidth + 2) {
|
||||
setWordBlock(caretXY());
|
||||
setSelWord();
|
||||
mStateFlags.setFlag(SynStateFlag::sfDblClicked);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -227,6 +227,7 @@ public:
|
|||
BufferCoord wordEndEx(const BufferCoord& XY);
|
||||
BufferCoord prevWordPos();
|
||||
BufferCoord prevWordPosEx(const BufferCoord& XY);
|
||||
|
||||
void commandProcessor(SynEditorCommand Command, QChar AChar = QChar(), void * pData = nullptr);
|
||||
//Caret
|
||||
void showCaret();
|
||||
|
@ -256,14 +257,14 @@ public:
|
|||
int maxScrollWidth() const;
|
||||
int maxScrollHeight() const;
|
||||
|
||||
bool getHighlighterAttriAtRowCol(const BufferCoord& XY, QString& Token,
|
||||
PSynHighlighterAttribute& Attri);
|
||||
bool getHighlighterAttriAtRowCol(const BufferCoord& XY, QString& Token,
|
||||
bool& tokenFinished, SynHighlighterTokenType& TokenType,
|
||||
PSynHighlighterAttribute& Attri);
|
||||
bool getHighlighterAttriAtRowColEx(const BufferCoord& XY, QString& Token,
|
||||
SynHighlighterTokenType& TokenType, SynTokenKind &TokenKind, int &Start,
|
||||
PSynHighlighterAttribute& Attri);
|
||||
bool getHighlighterAttriAtRowCol(const BufferCoord& pos, QString& token,
|
||||
PSynHighlighterAttribute& attri);
|
||||
bool getHighlighterAttriAtRowCol(const BufferCoord& pos, QString& token,
|
||||
bool& tokenFinished, SynHighlighterTokenType& tokenType,
|
||||
PSynHighlighterAttribute& attri);
|
||||
bool getHighlighterAttriAtRowColEx(const BufferCoord& pos, QString& token,
|
||||
SynHighlighterTokenType& tokenType, SynTokenKind &tokenKind, int &start,
|
||||
PSynHighlighterAttribute& attri);
|
||||
|
||||
void beginUndoBlock();
|
||||
void endUndoBlock();
|
||||
|
@ -287,6 +288,9 @@ public:
|
|||
virtual void selectAll() {
|
||||
commandProcessor(SynEditorCommand::ecSelectAll);
|
||||
}
|
||||
virtual void selectWord() {
|
||||
commandProcessor(SynEditorCommand::ecSelWord);
|
||||
}
|
||||
virtual void tab() { commandProcessor(SynEditorCommand::ecTab);}
|
||||
virtual void shifttab() { commandProcessor(SynEditorCommand::ecShiftTab);}
|
||||
virtual void toggleComment() { commandProcessor(SynEditorCommand::ecToggleComment);}
|
||||
|
@ -566,7 +570,10 @@ private:
|
|||
|
||||
void deleteFromTo(const BufferCoord& start, const BufferCoord& end);
|
||||
void setSelWord();
|
||||
void setWordBlock(BufferCoord Value);
|
||||
void setWordBlock(BufferCoord value);
|
||||
|
||||
void doExpandSelection(const BufferCoord& pos);
|
||||
void doShrinkSelection(const BufferCoord& pos);
|
||||
|
||||
|
||||
int calcIndentSpaces(int line, const QString& lineText, bool addIndent);
|
||||
|
|
|
@ -1974,6 +1974,14 @@ void Settings::CompilerSet::setProperties(const QString &binDir)
|
|||
delimPos2++;
|
||||
mVersion = output.mid(delimPos1,delimPos2-delimPos1);
|
||||
|
||||
// //fix for mingw64 gcc
|
||||
// double versionValue;
|
||||
// bool ok;
|
||||
// versionValue = mVersion.toDouble(&ok);
|
||||
// if (ok && versionValue>=12) {
|
||||
// mCompilerType=COMPILER_GCC_UTF8;
|
||||
// }
|
||||
|
||||
// Find compiler builder
|
||||
delimPos1 = delimPos2;
|
||||
while ((delimPos1 < output.length()) && !(output[delimPos1] == '('))
|
||||
|
@ -3376,6 +3384,26 @@ void Settings::Debugger::setGDBServerPort(int newGDBServerPort)
|
|||
mGDBServerPort = newGDBServerPort;
|
||||
}
|
||||
|
||||
int Settings::Debugger::memoryViewRows() const
|
||||
{
|
||||
return mMemoryViewRows;
|
||||
}
|
||||
|
||||
void Settings::Debugger::setMemoryViewRows(int newMemoryViewRows)
|
||||
{
|
||||
mMemoryViewRows = newMemoryViewRows;
|
||||
}
|
||||
|
||||
int Settings::Debugger::memoryViewColumns() const
|
||||
{
|
||||
return mMemoryViewColumns;
|
||||
}
|
||||
|
||||
void Settings::Debugger::setMemoryViewColumns(int newMemoryViewColumns)
|
||||
{
|
||||
mMemoryViewColumns = newMemoryViewColumns;
|
||||
}
|
||||
|
||||
bool Settings::Debugger::autosaveBreakpoints() const
|
||||
{
|
||||
return mAutosaveBreakpoints;
|
||||
|
@ -3433,6 +3461,8 @@ void Settings::Debugger::doSave()
|
|||
saveValue("open_cpu_info_when_signaled",mOpenCPUInfoWhenSignaled);
|
||||
saveValue("use_gdb_server", mUseGDBServer);
|
||||
saveValue("gdb_server_port",mGDBServerPort);
|
||||
saveValue("memory_view_rows",mMemoryViewRows);
|
||||
saveValue("memory_view_columns",mMemoryViewColumns);
|
||||
|
||||
}
|
||||
|
||||
|
@ -3461,6 +3491,8 @@ void Settings::Debugger::doLoad()
|
|||
mUseGDBServer = boolValue("use_gdb_server", true);
|
||||
#endif
|
||||
mGDBServerPort = intValue("gdb_server_port",41234);
|
||||
mMemoryViewRows = intValue("memory_view_rows",8);
|
||||
mMemoryViewColumns = intValue("memory_view_columns",8);
|
||||
}
|
||||
|
||||
Settings::History::History(Settings *settings):_Base(settings, SETTING_HISTORY)
|
||||
|
|
|
@ -1135,6 +1135,12 @@ public:
|
|||
int GDBServerPort() const;
|
||||
void setGDBServerPort(int newGDBServerPort);
|
||||
|
||||
int memoryViewRows() const;
|
||||
void setMemoryViewRows(int newMemoryViewRows);
|
||||
|
||||
int memoryViewColumns() const;
|
||||
void setMemoryViewColumns(int newMemoryViewColumns);
|
||||
|
||||
private:
|
||||
bool mEnableDebugConsole;
|
||||
bool mShowDetailLog;
|
||||
|
@ -1151,6 +1157,8 @@ public:
|
|||
bool mOpenCPUInfoWhenSignaled;
|
||||
bool mUseGDBServer;
|
||||
int mGDBServerPort;
|
||||
int mMemoryViewRows;
|
||||
int mMemoryViewColumns;
|
||||
|
||||
// _Base interface
|
||||
protected:
|
||||
|
|
|
@ -55,6 +55,8 @@ void DebugGeneralWidget::doLoad()
|
|||
ui->grpUseGDBServer->setChecked(pSettings->debugger().useGDBServer());
|
||||
#endif
|
||||
ui->spinGDBServerPort->setValue(pSettings->debugger().GDBServerPort());
|
||||
ui->spinMemoryViewRows->setValue(pSettings->debugger().memoryViewRows());
|
||||
ui->spinMemoryViewColumns->setValue(pSettings->debugger().memoryViewColumns());
|
||||
}
|
||||
|
||||
void DebugGeneralWidget::doSave()
|
||||
|
@ -76,6 +78,8 @@ void DebugGeneralWidget::doSave()
|
|||
pSettings->debugger().setUseGDBServer(ui->grpUseGDBServer->isChecked());
|
||||
#endif
|
||||
pSettings->debugger().setGDBServerPort(ui->spinGDBServerPort->value());
|
||||
pSettings->debugger().setMemoryViewRows(ui->spinMemoryViewRows->value());
|
||||
pSettings->debugger().setMemoryViewColumns(ui->spinMemoryViewColumns->value());
|
||||
pSettings->debugger().save();
|
||||
pMainWindow->updateDebuggerSettings();
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>704</width>
|
||||
<height>563</height>
|
||||
<height>774</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -197,6 +197,120 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Memory View</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<property name="leftMargin">
|
||||
<number>7</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>7</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_5" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Memory View Rows</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinMemoryViewRows">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>8</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_6" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Memory View Columns</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinMemoryViewColumns">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>8</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>437</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
|
@ -220,6 +334,12 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
<string>CPU Window</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkShowCPUWhenSignaled">
|
||||
<property name="text">
|
||||
|
@ -227,12 +347,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
<string>CPU Window</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_3" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
|
|
Loading…
Reference in New Issue