- enhancement: Show mousetip for numbers in the GNU assembly file.
This commit is contained in:
parent
8d9a79068d
commit
1504e6cb04
4
NEWS.md
4
NEWS.md
|
@ -1,8 +1,10 @@
|
||||||
Red Panda C++ Version 2.17
|
Red Panda C++ Version 2.17
|
||||||
|
|
||||||
- enhancement: Add X86_64 AVX/AVX instruction descriptions to asm syntaxer.
|
- enhancement: Add X86_64 AVX/AVX instruction descriptions to asm syntaxer.
|
||||||
- enhancement: Update to the newest x86 Assembly manual.
|
- enhancement: Update x86 Assembly manual link to the newest website.
|
||||||
- enhancement: Add "New Text File" in the File menu
|
- enhancement: Add "New Text File" in the File menu
|
||||||
|
- enhancement: Add "address" in the memory view's mouse tip.
|
||||||
|
- enhancement: Show mousetip for numbers in the GNU assembly file.
|
||||||
|
|
||||||
Red Panda C++ Version 2.16
|
Red Panda C++ Version 2.16
|
||||||
|
|
||||||
|
|
|
@ -3166,7 +3166,10 @@ QVariant MemoryModel::data(const QModelIndex &index, int role) const
|
||||||
return QString("%1").arg(line->datas[col],2,16,QChar('0'));
|
return QString("%1").arg(line->datas[col],2,16,QChar('0'));
|
||||||
} else if (role == Qt::ToolTipRole) {
|
} else if (role == Qt::ToolTipRole) {
|
||||||
if (col<line->datas.count()) {
|
if (col<line->datas.count()) {
|
||||||
QString s =tr("dec: %1").arg(line->datas[col])
|
QString s =
|
||||||
|
tr("addr: %1").arg(line->startAddress+col,0,16)
|
||||||
|
+"<br/>"
|
||||||
|
+tr("dec: %1").arg(line->datas[col])
|
||||||
+"<br/>"
|
+"<br/>"
|
||||||
+tr("oct: %1").arg(line->datas[col],0,8)
|
+tr("oct: %1").arg(line->datas[col],0,8)
|
||||||
+"<br/>"
|
+"<br/>"
|
||||||
|
|
|
@ -1882,6 +1882,15 @@ void Editor::onTooltipTimer()
|
||||||
pError = issues->front();
|
pError = issues->front();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (reason == TipType::Number) {
|
||||||
|
if (!syntaxer() ||
|
||||||
|
(syntaxer()->language() != QSynedit::ProgrammingLanguage::Assembly
|
||||||
|
&& syntaxer()->language() != QSynedit::ProgrammingLanguage::ATTAssembly
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
reason=TipType::None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Get subject
|
// Get subject
|
||||||
bool isIncludeLine = false;
|
bool isIncludeLine = false;
|
||||||
|
@ -1927,6 +1936,19 @@ void Editor::onTooltipTimer()
|
||||||
case TipType::Error:
|
case TipType::Error:
|
||||||
s = pError->token;
|
s = pError->token;
|
||||||
break;
|
break;
|
||||||
|
case TipType::Number:
|
||||||
|
if (!mCompletionPopup->isVisible()
|
||||||
|
&& !mHeaderCompletionPopup->isVisible()) {
|
||||||
|
QSynedit::PTokenAttribute attr;
|
||||||
|
int start;
|
||||||
|
if (getTokenAttriAtRowColEx(p,s,start,attr)) {
|
||||||
|
QString line=document()->getLine(p.line-1);
|
||||||
|
int idx=start-2;
|
||||||
|
if (idx>=0 && idx<line.length() && line[idx]=='-')
|
||||||
|
s='-'+s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case TipType::None:
|
case TipType::None:
|
||||||
cancelHint();
|
cancelHint();
|
||||||
mCurrentWord = "";
|
mCurrentWord = "";
|
||||||
|
@ -1955,7 +1977,6 @@ void Editor::onTooltipTimer()
|
||||||
mCurrentWord = s;
|
mCurrentWord = s;
|
||||||
mCurrentTipType = reason;
|
mCurrentTipType = reason;
|
||||||
|
|
||||||
|
|
||||||
// Determine what to do with subject
|
// Determine what to do with subject
|
||||||
QString hint = "";
|
QString hint = "";
|
||||||
switch (reason) {
|
switch (reason) {
|
||||||
|
@ -1984,6 +2005,33 @@ void Editor::onTooltipTimer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case TipType::Number:
|
||||||
|
if (syntaxer() &&
|
||||||
|
(syntaxer()->language() == QSynedit::ProgrammingLanguage::Assembly
|
||||||
|
|| syntaxer()->language() == QSynedit::ProgrammingLanguage::ATTAssembly)
|
||||||
|
) {
|
||||||
|
qDebug()<<s;
|
||||||
|
bool neg=false;
|
||||||
|
LONGLONG val;
|
||||||
|
bool ok;
|
||||||
|
if (s.startsWith("-")) {
|
||||||
|
s=s.mid(1);
|
||||||
|
neg=true;
|
||||||
|
}
|
||||||
|
if (s.startsWith("0x")) {
|
||||||
|
val=s.toLongLong(&ok,16);
|
||||||
|
} else {
|
||||||
|
val=s.toLongLong(&ok,10);
|
||||||
|
}
|
||||||
|
if (ok) {
|
||||||
|
if (neg)
|
||||||
|
val = -val;
|
||||||
|
hint=tr("hex: %1").arg((ULONGLONG)val,0,16)
|
||||||
|
+"<br />"
|
||||||
|
+tr("dec: %1").arg(val,0,10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case TipType::Keyword:
|
case TipType::Keyword:
|
||||||
if (pSettings->editor().enableIdentifierToolTips()) {
|
if (pSettings->editor().enableIdentifierToolTips()) {
|
||||||
if (syntaxer() &&
|
if (syntaxer() &&
|
||||||
|
@ -3854,6 +3902,8 @@ Editor::TipType Editor::getTipType(QPoint point, QSynedit::BufferCoord& pos)
|
||||||
return TipType::Preprocessor;
|
return TipType::Preprocessor;
|
||||||
} else if (attr->tokenType() == QSynedit::TokenType::Identifier) {
|
} else if (attr->tokenType() == QSynedit::TokenType::Identifier) {
|
||||||
return TipType::Identifier;
|
return TipType::Identifier;
|
||||||
|
} else if (attr->tokenType() == QSynedit::TokenType::Number) {
|
||||||
|
return TipType::Number;
|
||||||
} else if (attr->tokenType() == QSynedit::TokenType::Keyword) {
|
} else if (attr->tokenType() == QSynedit::TokenType::Keyword) {
|
||||||
return TipType::Keyword;
|
return TipType::Keyword;
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,6 +105,7 @@ public:
|
||||||
Identifier, // cursor hovers above identifier
|
Identifier, // cursor hovers above identifier
|
||||||
Selection, // cursor hovers above selection
|
Selection, // cursor hovers above selection
|
||||||
Keyword,
|
Keyword,
|
||||||
|
Number,
|
||||||
None, // mouseover not allowed
|
None, // mouseover not allowed
|
||||||
Error //Cursor hovers above error line/item;
|
Error //Cursor hovers above error line/item;
|
||||||
};
|
};
|
||||||
|
|
|
@ -439,6 +439,7 @@
|
||||||
<addaction name="actionStep_Over"/>
|
<addaction name="actionStep_Over"/>
|
||||||
<addaction name="actionStep_Into"/>
|
<addaction name="actionStep_Into"/>
|
||||||
<addaction name="actionStep_Out"/>
|
<addaction name="actionStep_Out"/>
|
||||||
|
<addaction name="actionRun_To_Cursor"/>
|
||||||
<addaction name="actionContinue"/>
|
<addaction name="actionContinue"/>
|
||||||
<addaction name="actionStop_Execution"/>
|
<addaction name="actionStop_Execution"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
|
@ -2398,6 +2399,10 @@
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionRun_To_Cursor">
|
<action name="actionRun_To_Cursor">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="icons.qrc">
|
||||||
|
<normaloff>:/icons/images/newlook24/052-next.png</normaloff>:/icons/images/newlook24/052-next.png</iconset>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Run To Cursor</string>
|
<string>Run To Cursor</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
@ -1046,6 +1046,14 @@
|
||||||
<source>Error Load File</source>
|
<source>Error Load File</source>
|
||||||
<translation type="unfinished">Erro ao carregar arquivo</translation>
|
<translation type="unfinished">Erro ao carregar arquivo</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>hex: %1</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>dec: %1</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>EditorAutoSaveWidget</name>
|
<name>EditorAutoSaveWidget</name>
|
||||||
|
@ -5138,6 +5146,10 @@
|
||||||
<source>bin: %1</source>
|
<source>bin: %1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>addr: %1</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>NewClassDialog</name>
|
<name>NewClassDialog</name>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -927,6 +927,14 @@
|
||||||
<source>Error Load File</source>
|
<source>Error Load File</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>hex: %1</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>dec: %1</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>EditorAutoSaveWidget</name>
|
<name>EditorAutoSaveWidget</name>
|
||||||
|
@ -4891,6 +4899,10 @@
|
||||||
<source>bin: %1</source>
|
<source>bin: %1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>addr: %1</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>NewClassDialog</name>
|
<name>NewClassDialog</name>
|
||||||
|
|
Loading…
Reference in New Issue