From 16c5120ddfc6016b6dc00b79f2fb831122f1fd4d Mon Sep 17 00:00:00 2001 From: Ezequiel Rosas Date: Tue, 15 Aug 2017 23:07:11 -0500 Subject: [PATCH] Handle Vim special cases --- SwiftNeoVim/NeoVimView+Key.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/SwiftNeoVim/NeoVimView+Key.swift b/SwiftNeoVim/NeoVimView+Key.swift index 1b807568..ee6133d9 100644 --- a/SwiftNeoVim/NeoVimView+Key.swift +++ b/SwiftNeoVim/NeoVimView+Key.swift @@ -102,6 +102,19 @@ extension NeoVimView { return true } + // For the following two conditions: + // See special cases in vim/os_win32.c from vim sources + // Also mentioned in MacVim's KeyBindings.plist + if .control == flags && chars == "6" { + self.agent.vimInput("\u{1e}") + return true + } + if .control == flags && chars == "2" { + // should generate \0, escaping as above + self.agent.vimInput(self.wrapNamedKeys("Nul")) + return true + } + return false }