mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 01:15:29 +02:00
Workaround for 195808: ProjectionViewer: Toggling between segmented and projection mode can fail
This commit is contained in:
parent
f695e81bd6
commit
bf4290500d
2 changed files with 28 additions and 0 deletions
|
@ -2592,6 +2592,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
|
|||
fOpenInViewGroup.fillActionBars(actionBars);
|
||||
fRefactoringActionGroup.fillActionBars(actionBars);
|
||||
fGenerateActionGroup.fillActionBars(actionBars);
|
||||
fFoldingGroup.updateActionBars();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -99,6 +99,11 @@ public class CSourceViewer extends ProjectionViewer implements IPropertyChangeLi
|
|||
* @since 4.0
|
||||
*/
|
||||
private boolean fIsSetVisibleDocumentDelayed;
|
||||
/**
|
||||
* Whether projection mode was enabled when switching to segmented mode.
|
||||
* Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=195808
|
||||
*/
|
||||
private boolean fWasProjectionMode;
|
||||
|
||||
/**
|
||||
* Creates new source viewer.
|
||||
|
@ -420,4 +425,26 @@ public class CSourceViewer extends ProjectionViewer implements IPropertyChangeLi
|
|||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* @see org.eclipse.jface.text.source.projection.ProjectionViewer#setVisibleRegion(int, int)
|
||||
*/
|
||||
public void setVisibleRegion(int start, int length) {
|
||||
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=195808
|
||||
if (!fWasProjectionMode && isProjectionMode()) {
|
||||
fWasProjectionMode= true;
|
||||
}
|
||||
super.setVisibleRegion(start, length);
|
||||
}
|
||||
|
||||
/*
|
||||
* @see org.eclipse.jface.text.source.projection.ProjectionViewer#resetVisibleRegion()
|
||||
*/
|
||||
public void resetVisibleRegion() {
|
||||
super.resetVisibleRegion();
|
||||
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=195808
|
||||
if (fWasProjectionMode) {
|
||||
fWasProjectionMode= false;
|
||||
enableProjection();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue