From f4f4efce92feb0c38323280ab916ff4ab0b27d6c Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Thu, 14 May 2020 23:44:22 +0300 Subject: [PATCH] [vcs-log] only provide tab titles for the VcsLogFile instances For other files getEditorTabTitle should return null to enable processing by other providers. follow-up: ab7add6a9a72ddd616185a826d921ab74cbe25e8 GitOrigin-RevId: cfbb4a1d5ace276effaa7c48f2e7e099f8e61f86 --- .../src/com/intellij/vcs/log/ui/editor/VcsLogEditor.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/editor/VcsLogEditor.kt b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/editor/VcsLogEditor.kt index 5ccf5d749b2f..1f0e58ca7952 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/editor/VcsLogEditor.kt +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/editor/VcsLogEditor.kt @@ -90,8 +90,10 @@ class VcsLogEditorProvider : FileEditorProvider, DumbAware { } class VcsLogEditorTabTitleProvider : EditorTabTitleProvider { - override fun getEditorTabTitle(project: Project, file: VirtualFile): String? = - file.getUserData(VCS_LOG_FILE_DISPLAY_NAME_GENERATOR) - ?.let { displayNameGenerator -> (file as? VcsLogFile)?.logUis?.run(displayNameGenerator) } - ?: file.name + override fun getEditorTabTitle(project: Project, file: VirtualFile): String? { + if (file !is VcsLogFile) return null + return file.getUserData(VCS_LOG_FILE_DISPLAY_NAME_GENERATOR) + ?.let { displayNameGenerator -> (file as? VcsLogFile)?.logUis?.run(displayNameGenerator) } + ?: file.name + } } \ No newline at end of file