1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-05-03 04:34:03 +02:00

[VIM-3620] Do not show the uninstall feedback when updating the plugin

This commit is contained in:
Alex Plate 2025-01-14 17:17:15 +02:00
parent 6ab0add430
commit 54b49d3322
No known key found for this signature in database
GPG Key ID: 0B97153C8FFEC09F

View File

@ -10,6 +10,7 @@ package com.maddyhome.idea.vim
import com.intellij.ide.BrowserUtil
import com.intellij.ide.plugins.IdeaPluginDescriptor
import com.intellij.ide.plugins.InstalledPluginsState
import com.intellij.ide.plugins.PluginStateListener
import com.intellij.ide.plugins.PluginStateManager
import com.intellij.openapi.application.ApplicationManager
@ -54,7 +55,11 @@ internal class PluginStartup : ProjectActivity/*, LightEditCompatible*/ {
}
override fun uninstall(descriptor: IdeaPluginDescriptor) {
if (descriptor.pluginId == VimPlugin.getPluginId()) {
val pluginId = VimPlugin.getPluginId()
// This event is called for both uninstall and update. There is no proper way to distinguish these two events.
// In order not to show the form for the update, we check if the new version is available. If so,
// this may be an update (and may not), and we don't show the form.
if (descriptor.pluginId == pluginId && !InstalledPluginsState.getInstance().hasNewerVersion(pluginId)) {
BrowserUtil.open("https://surveys.jetbrains.com/s3/ideavim-uninstall-feedback")
}
}