1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-03-04 21:32:52 +01:00

Show "create ~/.ideavimrc" if this file is missing

This commit is contained in:
Alex Plate 2021-04-25 15:22:22 +03:00
parent 341f1e915f
commit 35ab292c9f
No known key found for this signature in database
GPG Key ID: 0B97153C8FFEC09F

View File

@ -224,8 +224,7 @@ class NotificationService(private val project: Project?) {
}
@Suppress("DialogTitleCapitalization")
class OpenIdeaVimRcAction(private val notification: Notification?) :
DumbAwareAction("Open ~/.ideavimrc")/*, LightEditCompatible*/ {
class OpenIdeaVimRcAction(private val notification: Notification?) : DumbAwareAction()/*, LightEditCompatible*/ {
override fun actionPerformed(e: AnActionEvent) {
val eventProject = e.project
if (eventProject != null) {
@ -242,6 +241,12 @@ class NotificationService(private val project: Project?) {
eventProject
)
}
override fun update(e: AnActionEvent) {
super.update(e)
val actionText = if (VimScriptParser.findIdeaVimRc() != null) "Open ~/.ideavimrc" else "Create ~/.ideavimrc"
e.presentation.text = actionText
}
}
@Suppress("DialogTitleCapitalization")