File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
kotlin/com/firsttimeinforever/intellij/pdf/viewer/actions Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -51,9 +51,14 @@ abstract class PdfAction(protected val viewModeAwareness: ViewModeAwareness = Vi
5151 * is possible that there is a PDF open somewhere, but it is not in view.
5252 */
5353 fun findEditorInView (event : AnActionEvent ): PdfFileEditor ? {
54- val focusedEditor = event.getData(PlatformDataKeys .FILE_EDITOR ) as ? PdfFileEditor
54+ val focusedEditor = event.getData(PlatformDataKeys .FILE_EDITOR )
5555
56- return focusedEditor ? : run {
56+ if (focusedEditor?.javaClass?.simpleName == " BackendDiffRequestProcessorEditor" ) {
57+ // This is a diff view, which we cannot control, so don't do anything
58+ return null
59+ }
60+
61+ return focusedEditor as ? PdfFileEditor ? : run {
5762 val project = event.project ? : return null
5863 FileEditorManager .getInstance(project).selectedEditors.firstOrNull {it is PdfFileEditor } as ? PdfFileEditor
5964 }
Original file line number Diff line number Diff line change 1212 <extensions defaultExtensionNs =" com.intellij" >
1313 <fileType name =" PDF"
1414 extensions =" pdf"
15- language =" PDF"
1615 fieldName =" INSTANCE"
1716 implementationClass =" com.firsttimeinforever.intellij.pdf.viewer.lang.PdfFileType" />
1817 <fileEditorProvider implementation =" com.firsttimeinforever.intellij.pdf.viewer.ui.editor.PdfFileEditorProvider" />
You can’t perform that action at this time.
0 commit comments