mirror of
https://github.com/fadden/6502bench.git
synced 2025-02-20 06:29:04 +00:00
Fix double-click jump to local var with annotation
Double-clicking the opcode of an instruction that references a local variable (e.g. "LDA ]foo") moves the selection to the line that declares the variable. This wasn't working in the case where the local var was annotated (e.g. "LDA ]foo?").
This commit is contained in:
parent
c535201884
commit
d4b97007df
@ -2713,6 +2713,16 @@ namespace SourceGen {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Find the actual symbol definition.
|
||||||
|
LocalVariableTable lvTable = mProject.LvTables[varOffset];
|
||||||
|
DefSymbol foundSym = lvTable.GetByLabel(symRef.Label);
|
||||||
|
if (foundSym == null) {
|
||||||
|
// shouldn't be possible
|
||||||
|
Debug.WriteLine("Did not find " + symRef.Label + " in expected table");
|
||||||
|
Debug.Assert(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// We have the offset to which the local variable table is bound. We need to
|
// We have the offset to which the local variable table is bound. We need to
|
||||||
// walk down until we find the variable definitions, and find the line with the
|
// walk down until we find the variable definitions, and find the line with the
|
||||||
// matching symbol.
|
// matching symbol.
|
||||||
@ -2720,7 +2730,10 @@ namespace SourceGen {
|
|||||||
// We're comparing to the formatted strings -- safer than trying to find the symbol
|
// We're comparing to the formatted strings -- safer than trying to find the symbol
|
||||||
// in the table and then guess at how the table arranges itself for display -- so we
|
// in the table and then guess at how the table arranges itself for display -- so we
|
||||||
// need to compare the formatted form of the label.
|
// need to compare the formatted form of the label.
|
||||||
string cmpStr = mFormatter.FormatVariableLabel(symRef.Label);
|
//
|
||||||
|
// We need to use GenerateDisplayLabel() because the symbol might have an annotation.
|
||||||
|
string cmpStr = mFormatter.FormatVariableLabel(
|
||||||
|
foundSym.GenerateDisplayLabel(mFormatter));
|
||||||
int lineIndex = CodeLineList.FindLineIndexByOffset(varOffset);
|
int lineIndex = CodeLineList.FindLineIndexByOffset(varOffset);
|
||||||
while (lineIndex < mProject.FileDataLength) {
|
while (lineIndex < mProject.FileDataLength) {
|
||||||
LineListGen.Line line = CodeLineList[lineIndex];
|
LineListGen.Line line = CodeLineList[lineIndex];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user