Skip to content

Commit

Permalink
CWM-927 disable vim for client's hidden editor on host
Browse files Browse the repository at this point in the history
to provide compatibility with Code With Me plugin
  • Loading branch information
vladimir-petrenko committed Dec 8, 2020
1 parent 3aa6fe3 commit efa895b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/com/maddyhome/idea/vim/helper/EditorHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

package com.maddyhome.idea.vim.helper

import com.intellij.codeWithMe.ClientId
import com.intellij.openapi.diagnostic.logger
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.editor.ex.util.EditorUtil
Expand All @@ -46,6 +47,9 @@ val Editor.isIdeaVimDisabledHere: Boolean
val timeForCalculation = measureTimeMillis {
res = (disabledInDialog.apply { times += System.currentTimeMillis() to "Disabled in dialog" }

|| (!ClientId.isCurrentlyUnderLocalId) // CWM-927
.apply { times += System.currentTimeMillis() to "is Host-side editor check (Code With Me)" }

|| (!OptionsManager.ideavimsupport.contains("singleline")
.apply { times += System.currentTimeMillis() to "first single line check" }
&& isDatabaseCell(times).apply { times += System.currentTimeMillis() to "is db cell" })
Expand Down

0 comments on commit efa895b

Please sign in to comment.