Skip to content

Commit

Permalink
Fix new pannel not opening in IJ 242+ (#2432)
Browse files Browse the repository at this point in the history
Fixes https://linear.app/sourcegraph/issue/QA-112/

## Test plan

Please test with both lowest and highest supported IJ versions.

**Opening new panel:**

1. Open IJ  with Cody installed 
2. Click "Open in Editor" button (`[ | ]` icon)

**Moving panels around:**

1. Open IJ with Cody installed 
2. Click "Open in Editor" button (`[ | ]` icon) few times to open few
tabs
3. Move them around - change tab orders, move them between split
windows, etc

Expected result: new panel should be opened
  • Loading branch information
pkukielka authored Oct 10, 2024
1 parent 0e8d25b commit 9b79055
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ package com.sourcegraph.cody.ui.web
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.fileEditor.FileEditor
import com.intellij.openapi.fileEditor.FileEditorLocation
import com.intellij.openapi.fileEditor.FileEditorManager
import com.intellij.openapi.fileEditor.FileEditorPolicy
import com.intellij.openapi.fileEditor.FileEditorProvider
import com.intellij.openapi.fileEditor.FileEditorState
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx
import com.intellij.openapi.project.DumbAware
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.Key
Expand Down Expand Up @@ -77,8 +75,6 @@ class WebPanelProvider : FileEditorProvider, DumbAware {

override fun createEditor(project: Project, file: VirtualFile): FileEditor {
ApplicationManager.getApplication().assertIsDispatchThread()
// If this file is already open elsewhere, close it.
(FileEditorManager.getInstance(project) as? FileEditorManagerEx)?.closeFile(file)

// If file was reopened we don't want to dispose WebView, as it means panel was just moved
// between editors
Expand Down

0 comments on commit 9b79055

Please sign in to comment.