1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-03-01 13:46:02 +01:00

Unbind VimDataType from Variable

This commit is contained in:
Alex Plate 2022-02-24 12:44:13 +03:00
parent d27f87fbb8
commit 6eb47567e8
No known key found for this signature in database
GPG Key ID: 0B97153C8FFEC09F
2 changed files with 2 additions and 4 deletions
src/main/java/com/maddyhome/idea/vim/vimscript/model

View File

@ -75,7 +75,7 @@ data class LetCommand(
}
val leftValue = VimPlugin.getVariableService().getNullableVariableValue(variable, editor, context, vimContext)
if (leftValue?.isLocked == true && leftValue.lockOwner?.name == variable.name) {
if (leftValue?.isLocked == true && (leftValue.lockOwner as? Variable)?.name == variable.name) {
throw ExException("E741: Value is locked: ${variable.toString(editor, context, vimContext)}")
}
val rightValue = expression.evaluate(editor, context, vimContext)

View File

@ -18,8 +18,6 @@
package com.maddyhome.idea.vim.vimscript.model.datatypes
import com.maddyhome.idea.vim.vimscript.model.expressions.Variable
sealed class VimDataType {
abstract fun asDouble(): Double
@ -40,7 +38,7 @@ sealed class VimDataType {
abstract fun deepCopy(level: Int = 100): VimDataType
var lockOwner: Variable? = null
var lockOwner: Any? = null
var isLocked: Boolean = false
abstract fun lockVar(depth: Int)