mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-14 12:35:22 +02:00
bug 205393: [terminal] terminal causes stack overflow
https://bugs.eclipse.org/bugs/show_bug.cgi?id=205393
This commit is contained in:
parent
a6bab8287c
commit
a4699ff8ef
1 changed files with 26 additions and 16 deletions
|
@ -35,6 +35,10 @@ abstract public class AbstractTextCanvasModel implements ITextCanvasModel {
|
||||||
private ITerminalTextDataSnapshot fSelectionSnapshot;
|
private ITerminalTextDataSnapshot fSelectionSnapshot;
|
||||||
private String fCurrentSelection=""; //$NON-NLS-1$
|
private String fCurrentSelection=""; //$NON-NLS-1$
|
||||||
private final Point fSelectionAnchor=new Point(0,0);
|
private final Point fSelectionAnchor=new Point(0,0);
|
||||||
|
/**
|
||||||
|
* do not update while update is running
|
||||||
|
*/
|
||||||
|
boolean fInUpdate;
|
||||||
|
|
||||||
public AbstractTextCanvasModel(ITerminalTextDataSnapshot snapshot) {
|
public AbstractTextCanvasModel(ITerminalTextDataSnapshot snapshot) {
|
||||||
fSnapshot=snapshot;
|
fSnapshot=snapshot;
|
||||||
|
@ -75,22 +79,28 @@ abstract public class AbstractTextCanvasModel implements ITextCanvasModel {
|
||||||
return fSnapshot;
|
return fSnapshot;
|
||||||
}
|
}
|
||||||
protected void updateSnapshot() {
|
protected void updateSnapshot() {
|
||||||
if(fSnapshot.isOutOfDate()) {
|
if(!fInUpdate && fSnapshot.isOutOfDate()) {
|
||||||
fSnapshot.updateSnapshot(false);
|
fInUpdate=true;
|
||||||
if(fSnapshot.hasTerminalChanged())
|
try {
|
||||||
fireTerminalDataChanged();
|
fSnapshot.updateSnapshot(false);
|
||||||
// TODO why does hasDimensionsChanged not work??????
|
if(fSnapshot.hasTerminalChanged())
|
||||||
// if(fSnapshot.hasDimensionsChanged())
|
fireTerminalDataChanged();
|
||||||
// fireDimensionsChanged();
|
// TODO why does hasDimensionsChanged not work??????
|
||||||
if(fLines!=fSnapshot.getHeight()) {
|
// if(fSnapshot.hasDimensionsChanged())
|
||||||
fireDimensionsChanged(fSnapshot.getWidth(),fSnapshot.getHeight());
|
// fireDimensionsChanged();
|
||||||
fLines=fSnapshot.getHeight();
|
if(fLines!=fSnapshot.getHeight()) {
|
||||||
}
|
fireDimensionsChanged(fSnapshot.getWidth(),fSnapshot.getHeight());
|
||||||
int y=fSnapshot.getFirstChangedLine();
|
fLines=fSnapshot.getHeight();
|
||||||
// has any line changed?
|
}
|
||||||
if(y<Integer.MAX_VALUE) {
|
int y=fSnapshot.getFirstChangedLine();
|
||||||
int height=fSnapshot.getLastChangedLine()-y+1;
|
// has any line changed?
|
||||||
fireCellRangeChanged(0, y, fSnapshot.getWidth(), height);
|
if(y<Integer.MAX_VALUE) {
|
||||||
|
int height=fSnapshot.getLastChangedLine()-y+1;
|
||||||
|
fireCellRangeChanged(0, y, fSnapshot.getWidth(), height);
|
||||||
|
}
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
fInUpdate=false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue