mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-03 05:33:33 +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:
parent
1cf226434d
commit
91cdaecd4c
1 changed files with 7 additions and 5 deletions
|
@ -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) {
|
||||||
|
if (fSyncProblemsViewMarker==null) {
|
||||||
updateMarkerViews(annotation);
|
updateMarkerViews(annotation);
|
||||||
|
}
|
||||||
if (annotation instanceof ICAnnotation && ((ICAnnotation) annotation).isProblem())
|
if (annotation instanceof ICAnnotation && ((ICAnnotation) annotation).isProblem())
|
||||||
setStatusLineMessage(annotation.getText());
|
setStatusLineMessage(annotation.getText());
|
||||||
}
|
}
|
||||||
|
fSyncProblemsViewMarker = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue