mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-115693 Exception on Show Bookmarks
This commit is contained in:
@@ -89,6 +89,7 @@ public interface DetailView extends UserDataHolder {
|
||||
return myFile;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public LogicalPosition getNavigate() {
|
||||
return myNavigate;
|
||||
}
|
||||
@@ -101,7 +102,7 @@ public interface DetailView extends UserDataHolder {
|
||||
private final LogicalPosition myNavigate;
|
||||
private final TextAttributes myAttributes;
|
||||
|
||||
public PreviewEditorState(VirtualFile file, LogicalPosition navigate, TextAttributes attributes) {
|
||||
public PreviewEditorState(VirtualFile file, @Nullable LogicalPosition navigate, TextAttributes attributes) {
|
||||
|
||||
myFile = file;
|
||||
myNavigate = navigate;
|
||||
|
||||
@@ -156,14 +156,16 @@ public class DetailViewImpl extends JPanel implements DetailView, UserDataHolder
|
||||
add(getEditor().getComponent(), BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
getEditor().getCaretModel().moveToLogicalPosition(positionToNavigate);
|
||||
validate();
|
||||
getEditor().getScrollingModel().scrollToCaret(ScrollType.CENTER);
|
||||
if (positionToNavigate != null) {
|
||||
getEditor().getCaretModel().moveToLogicalPosition(positionToNavigate);
|
||||
validate();
|
||||
getEditor().getScrollingModel().scrollToCaret(ScrollType.CENTER);
|
||||
}
|
||||
|
||||
getEditor().setBorder(IdeBorderFactory.createBorder(SideBorder.TOP));
|
||||
|
||||
clearHightlighting();
|
||||
if (lineAttributes != null) {
|
||||
if (lineAttributes != null && positionToNavigate != null) {
|
||||
myHighlighter = getEditor().getMarkupModel().addLineHighlighter(positionToNavigate.line, HighlighterLayer.SELECTION - 1,
|
||||
lineAttributes);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user