[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
This commit is contained in:
Julia Beliaeva
2020-05-14 21:24:16 +00:00
committed by intellij-monorepo-bot
parent 7e46431d30
commit f4f4efce92
@@ -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
}
}