Introduce wrapper for EditorFactoryListener to warn about compatibility issues

This commit is contained in:
Nikolay Krasko
2019-01-17 16:59:40 +03:00
parent 74bc440e44
commit 3548d25095
5 changed files with 42 additions and 7 deletions
@@ -28,9 +28,9 @@ import com.intellij.openapi.editor.RangeMarker
import com.intellij.openapi.editor.event.CaretEvent
import com.intellij.openapi.editor.event.CaretListener
import com.intellij.openapi.editor.event.EditorFactoryEvent
import com.intellij.openapi.editor.event.EditorFactoryListener
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.Key
import org.jetbrains.kotlin.idea.util.compat.EditorFactoryListenerWrapper
class LookupCancelWatcher(val project: Project) : ProjectComponent {
private class Reminiscence(editor: Editor, offset: Int) {
@@ -105,17 +105,12 @@ class LookupCancelWatcher(val project: Project) : ProjectComponent {
override fun initComponent() {
EditorFactory.getInstance().addEditorFactoryListener(
object : EditorFactoryListener {
object : EditorFactoryListenerWrapper {
override fun editorReleased(event: EditorFactoryEvent) {
if (lastReminiscence?.editor == event.editor) {
lastReminiscence!!.dispose()
}
}
override fun editorCreated(event: EditorFactoryEvent) {
// BUNCH: 182 Has default implementation since 183
// Do nothing
}
},
project
)