1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

146670 Editing memory when memory is highlighted does not edit the address one would expect

This commit is contained in:
Ted Williams 2007-03-14 07:18:56 +00:00
parent 19311472a6
commit b30041aff3
2 changed files with 25 additions and 0 deletions

View file

@ -268,6 +268,9 @@ public abstract class AbstractPane extends Canvas
}
else if(Rendering.isValidEditCharacter(ke.character))
{
if(fRendering.getSelection().hasSelection())
setCaretAddress(fRendering.getSelection().getLow());
editCell(fCaretAddress, fSubCellCaretPosition, ke.character);
}

View file

@ -1756,6 +1756,12 @@ class Rendering extends Composite implements IDebugEventSetListener
redrawPanes();
}
protected boolean hasSelection()
{
return fStartHigh != null && fStartLow != null
&& fEndHigh != null && fEndLow != null;
}
protected boolean isSelected(BigInteger address)
{
// do we have valid start and end addresses
@ -1844,6 +1850,22 @@ class Rendering extends Composite implements IDebugEventSetListener
redrawPanes();
}
protected BigInteger getHigh()
{
if(!hasSelection())
return null;
return getStart().max(getEnd());
}
protected BigInteger getLow()
{
if(!hasSelection())
return null;
return getStart().min(getEnd());
}
protected BigInteger getStart()
{
// if there is no start, return null