1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-03 21:53:39 +02:00

bug 302272: When clicked on a bookmark in bookmark window focus in edit window goes to the file which was bookmarked but to a different line

This commit is contained in:
Andrew Gvozdev 2010-02-10 02:50:43 +00:00
parent 1cf226434d
commit 91cdaecd4c

View file

@ -228,7 +228,9 @@ import org.eclipse.cdt.internal.ui.viewsupport.SelectionListenerWithASTManager;
*/ */
public class CEditor extends TextEditor implements ISelectionChangedListener, ICReconcilingListener { public class CEditor extends TextEditor implements ISelectionChangedListener, ICReconcilingListener {
/** Marker used for synchronization from Problems View to the editor on double-click. */
private IMarker fSyncProblemsViewMarker = null; private IMarker fSyncProblemsViewMarker = null;
/** /**
* A slightly modified implementation of IGotomarker compared to AbstractDecoratedTextEditor. * A slightly modified implementation of IGotomarker compared to AbstractDecoratedTextEditor.
* *
@ -245,8 +247,6 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
if (getSourceViewer() == null) if (getSourceViewer() == null)
return; return;
fSyncProblemsViewMarker = marker;
int start= MarkerUtilities.getCharStart(marker); int start= MarkerUtilities.getCharStart(marker);
int end= MarkerUtilities.getCharEnd(marker); int end= MarkerUtilities.getCharEnd(marker);
@ -297,7 +297,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
int length= document.getLength(); int length= document.getLength();
if (end - 1 < length && start < length) { if (end - 1 < length && start < length) {
fIsUpdatingMarkerViews= true; fSyncProblemsViewMarker = marker;
selectAndReveal(start, end - start); selectAndReveal(start, end - start);
} }
} }
@ -2511,14 +2511,16 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
protected void updateStatusLine() { protected void updateStatusLine() {
ITextSelection selection = (ITextSelection) getSelectionProvider().getSelection(); ITextSelection selection = (ITextSelection) getSelectionProvider().getSelection();
Annotation annotation = getAnnotation(selection.getOffset(), selection.getLength(), fSyncProblemsViewMarker); Annotation annotation = getAnnotation(selection.getOffset(), selection.getLength(), fSyncProblemsViewMarker);
fSyncProblemsViewMarker = null;
setStatusLineErrorMessage(null); setStatusLineErrorMessage(null);
setStatusLineMessage(null); setStatusLineMessage(null);
if (annotation != null) { if (annotation != null) {
updateMarkerViews(annotation); if (fSyncProblemsViewMarker==null) {
updateMarkerViews(annotation);
}
if (annotation instanceof ICAnnotation && ((ICAnnotation) annotation).isProblem()) if (annotation instanceof ICAnnotation && ((ICAnnotation) annotation).isProblem())
setStatusLineMessage(annotation.getText()); setStatusLineMessage(annotation.getText());
} }
fSyncProblemsViewMarker = null;
} }
/** /**