Skip to content

Commit

Permalink
fix incorrect editor #39
Browse files Browse the repository at this point in the history
  • Loading branch information
reymondzzzz committed Nov 14, 2023
1 parent 5aac0a3 commit 320f39a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ class LastEditorGetterListener : EditorFactoryListener, FileEditorManagerListene
}

override fun fileOpened(source: FileEditorManager, file: VirtualFile) {
val editor = EditorFactory.getInstance().allEditors.first { getVirtualFile(it) == file }
setup(editor)
val editor = EditorFactory.getInstance().allEditors.firstOrNull { getVirtualFile(it) == file }
if (editor != null) {
setup(editor)
}
}

override fun editorCreated(event: EditorFactoryEvent) {}
Expand Down

0 comments on commit 320f39a

Please sign in to comment.