mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-02-28 02:45:59 +01:00
Fix register
This commit is contained in:
parent
02c64feff8
commit
3394d93b43
@ -22,6 +22,7 @@ import com.intellij.openapi.actionSystem.DataContext
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.ex.ExException
|
||||
import com.maddyhome.idea.vim.helper.StringHelper
|
||||
import com.maddyhome.idea.vim.vimscript.model.Executable
|
||||
import com.maddyhome.idea.vim.vimscript.model.datatypes.VimDataType
|
||||
import com.maddyhome.idea.vim.vimscript.model.datatypes.VimString
|
||||
@ -30,6 +31,7 @@ data class Register(val char: Char) : Expression() {
|
||||
|
||||
override fun evaluate(editor: Editor, context: DataContext, parent: Executable): VimDataType {
|
||||
val register = VimPlugin.getRegister().getRegister(char) ?: throw ExException("Register is not supported yet")
|
||||
return register.rawText?.let { VimString(it) } ?: VimString("")
|
||||
// todo Esc like keys should be one char
|
||||
return VimString(StringHelper.toKeyNotation(register.keys))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user