2017-11-26 22:25:25 +03:00
|
|
|
//: Playground - noun: a place where people can play
|
|
|
|
|
|
|
|
import Cocoa
|
|
|
|
import NvimMsgPack
|
|
|
|
|
|
|
|
// Start nvim as follows:
|
|
|
|
// $ NVIM_LISTEN_ADDRESS=/tmp/nvim.sock nvim $SOME_FILES
|
2017-12-03 11:59:15 +03:00
|
|
|
guard let nvim = NvimApi(at: "/tmp/nvim.sock") else {
|
2017-11-26 22:25:25 +03:00
|
|
|
preconditionFailure("Could not connect to nvim")
|
|
|
|
}
|
|
|
|
|
2017-12-01 17:34:00 +03:00
|
|
|
nvim.connect()
|
|
|
|
|
2017-12-01 23:37:06 +03:00
|
|
|
if nvim.getMode().value?.dictionaryValue?[.string("blocked")]?.boolValue == true {
|
|
|
|
print("blocked!")
|
|
|
|
} else {
|
|
|
|
print("not blocked!")
|
|
|
|
}
|
|
|
|
|
|
|
|
print(nvim.getMode())
|