switch to synchronous neovim library

macos-click-through
keith 4 years ago
parent 4fd863ca2c
commit 197c68f4b2

565
Cargo.lock generated

@ -74,12 +74,6 @@ dependencies = [
"num-traits", "num-traits",
] ]
[[package]]
name = "arc-swap"
version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034"
[[package]] [[package]]
name = "arrayref" name = "arrayref"
version = "0.3.6" version = "0.3.6"
@ -101,17 +95,6 @@ dependencies = [
"libloading 0.6.3", "libloading 0.6.3",
] ]
[[package]]
name = "async-trait"
version = "0.1.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e1a4a2f97ce50c9d0282c1468816208588441492b40d813b2e0419c22c05e7f"
dependencies = [
"proc-macro2 1.0.19",
"quote 1.0.7",
"syn 1.0.39",
]
[[package]] [[package]]
name = "atty" name = "atty"
version = "0.2.14" version = "0.2.14"
@ -137,9 +120,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
[[package]] [[package]]
name = "base64" name = "base64"
version = "0.11.0" version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
[[package]] [[package]]
name = "bindgen" name = "bindgen"
@ -157,7 +140,7 @@ dependencies = [
"lazycell", "lazycell",
"log", "log",
"peeking_take_while", "peeking_take_while",
"proc-macro2 1.0.19", "proc-macro2 1.0.21",
"quote 1.0.7", "quote 1.0.7",
"regex", "regex",
"rustc-hash", "rustc-hash",
@ -194,22 +177,6 @@ version = "1.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
[[package]]
name = "bytes"
version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c"
dependencies = [
"byteorder",
"iovec",
]
[[package]]
name = "bytes"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38"
[[package]] [[package]]
name = "calloop" name = "calloop"
version = "0.4.4" version = "0.4.4"
@ -352,80 +319,81 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
[[package]] [[package]]
name = "core-foundation" name = "core-foundation"
version = "0.6.4" version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171"
dependencies = [ dependencies = [
"core-foundation-sys 0.6.2", "core-foundation-sys 0.7.0",
"libc", "libc",
] ]
[[package]] [[package]]
name = "core-foundation" name = "core-foundation"
version = "0.7.0" version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" checksum = "3b5ed8e7e76c45974e15e41bfa8d5b0483cd90191639e01d8f5f1e606299d3fb"
dependencies = [ dependencies = [
"core-foundation-sys 0.7.0", "core-foundation-sys 0.8.0",
"libc", "libc",
] ]
[[package]] [[package]]
name = "core-foundation-sys" name = "core-foundation-sys"
version = "0.6.2" version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac"
[[package]] [[package]]
name = "core-foundation-sys" name = "core-foundation-sys"
version = "0.7.0" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" checksum = "9a21fa21941700a3cd8fcb4091f361a6a712fac632f85d9f487cc892045d55c6"
[[package]] [[package]]
name = "core-graphics" name = "core-graphics"
version = "0.17.3" version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56790968ab1c8a1202a102e6de05fc6e1ec87da99e4e93e9a7d13efbfc1e95a9" checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"core-foundation 0.6.4", "core-foundation 0.7.0",
"foreign-types", "foreign-types",
"libc", "libc",
] ]
[[package]] [[package]]
name = "core-graphics" name = "core-graphics"
version = "0.19.2" version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" checksum = "f6082396a349fa49674ba1bda4077332a18bf150e8fa75745ece07085e29a113"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"core-foundation 0.7.0", "core-foundation 0.9.0",
"core-graphics-types",
"foreign-types", "foreign-types",
"libc", "libc",
] ]
[[package]] [[package]]
name = "core-text" name = "core-graphics-types"
version = "13.3.2" version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db84654ad95211c082cf9795f6f83dc17d0ae6c985ac1b906369dc7384ed346d" checksum = "e92f5d519093a4178296707dbaa3880eae85a5ef5386675f361a1cf25376e93c"
dependencies = [ dependencies = [
"core-foundation 0.6.4", "bitflags",
"core-graphics 0.17.3", "core-foundation 0.9.0",
"foreign-types", "foreign-types",
"libc", "libc",
] ]
[[package]] [[package]]
name = "core-text" name = "core-text"
version = "15.0.0" version = "19.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "131b3fd1f8bd5db9f2b398fa4fdb6008c64afc04d447c306ac2c7e98fba2a61d" checksum = "04dfae50af11e72657fe7174cddb1ecddc5398037f7f6f39533ad69207c9a4e2"
dependencies = [ dependencies = [
"core-foundation 0.7.0", "core-foundation 0.9.0",
"core-graphics 0.19.2", "core-graphics 0.22.0",
"foreign-types", "foreign-types",
"libc", "libc",
] ]
@ -454,12 +422,12 @@ dependencies = [
[[package]] [[package]]
name = "crossbeam-channel" name = "crossbeam-channel"
version = "0.4.3" version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ee0cc8804d5393478d743b035099520087a5186f3b93fa58cec08fa62407b6" checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87"
dependencies = [ dependencies = [
"cfg-if",
"crossbeam-utils", "crossbeam-utils",
"maybe-uninit",
] ]
[[package]] [[package]]
@ -545,9 +513,9 @@ version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb582b60359da160a9477ee80f15c8d784c477e69c217ef2cdd4169c24ea380f" checksum = "cb582b60359da160a9477ee80f15c8d784c477e69c217ef2cdd4169c24ea380f"
dependencies = [ dependencies = [
"proc-macro2 1.0.19", "proc-macro2 1.0.21",
"quote 1.0.7", "quote 1.0.7",
"syn 1.0.39", "syn 1.0.40",
] ]
[[package]] [[package]]
@ -556,9 +524,9 @@ version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71f31892cd5c62e414316f2963c5689242c43d8e7bbcaaeca97e5e28c95d91d9" checksum = "71f31892cd5c62e414316f2963c5689242c43d8e7bbcaaeca97e5e28c95d91d9"
dependencies = [ dependencies = [
"proc-macro2 1.0.19", "proc-macro2 1.0.21",
"quote 1.0.7", "quote 1.0.7",
"syn 1.0.39", "syn 1.0.40",
] ]
[[package]] [[package]]
@ -617,9 +585,9 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650"
[[package]] [[package]]
name = "dwrote" name = "dwrote"
version = "0.10.0" version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bcdf488e3a52a7aa30a05732a3e58420e22acb4b2b75635a561fc6ffbcab59ef" checksum = "439a1c2ba5611ad3ed731280541d36d2e9c4ac5e7fb818a27b604bdc5a6aa65b"
dependencies = [ dependencies = [
"lazy_static", "lazy_static",
"libc", "libc",
@ -725,23 +693,17 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7bad48618fdb549078c333a7a8528acb57af271d0433bdecd523eb620628364e" checksum = "7bad48618fdb549078c333a7a8528acb57af271d0433bdecd523eb620628364e"
[[package]]
name = "fnv"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]] [[package]]
name = "font-kit" name = "font-kit"
version = "0.6.0" version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f953474ebbe3460775ed2da52435477cc029493284d6ceb635598586a2c6298" checksum = "1f9042cb45150fb2b2a012fc03d0f1d2071f18e90397b9d2a5ec8ade8464bf20"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"byteorder", "byteorder",
"core-foundation 0.7.0", "core-foundation 0.9.0",
"core-graphics 0.19.2", "core-graphics 0.22.0",
"core-text 15.0.0", "core-text",
"dirs", "dirs",
"dwrote", "dwrote",
"float-ord", "float-ord",
@ -779,12 +741,23 @@ checksum = "69a039c3498dc930fe810151a34ba0c1c70b02b8625035592e74432f678591f2"
[[package]] [[package]]
name = "freetype" name = "freetype"
version = "0.4.1" version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11926b2b410b469d0e9399eca4cbbe237a9ef02176c485803b29216307e8e028" checksum = "bee38378a9e3db1cc693b4f88d166ae375338a0ff75cb8263e1c601d51f35dc6"
dependencies = [ dependencies = [
"freetype-sys",
"libc", "libc",
"servo-freetype-sys", ]
[[package]]
name = "freetype-sys"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a37d4011c0cc628dfa766fcc195454f4b068d7afdc2adfd28861191d866e731a"
dependencies = [
"cmake",
"libc",
"pkg-config",
] ]
[[package]] [[package]]
@ -803,118 +776,15 @@ version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
[[package]]
name = "futures"
version = "0.1.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef"
[[package]]
name = "futures"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613"
dependencies = [
"futures-channel",
"futures-core",
"futures-executor",
"futures-io",
"futures-sink",
"futures-task",
"futures-util",
]
[[package]]
name = "futures-channel"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5"
dependencies = [
"futures-core",
"futures-sink",
]
[[package]]
name = "futures-core"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399"
[[package]]
name = "futures-executor"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314"
dependencies = [
"futures-core",
"futures-task",
"futures-util",
]
[[package]]
name = "futures-io"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789"
[[package]]
name = "futures-macro"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39"
dependencies = [
"proc-macro-hack",
"proc-macro2 1.0.19",
"quote 1.0.7",
"syn 1.0.39",
]
[[package]]
name = "futures-sink"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc"
[[package]]
name = "futures-task"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626"
dependencies = [
"once_cell",
]
[[package]]
name = "futures-util"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6"
dependencies = [
"futures 0.1.29",
"futures-channel",
"futures-core",
"futures-io",
"futures-macro",
"futures-sink",
"futures-task",
"memchr",
"pin-project",
"pin-utils",
"proc-macro-hack",
"proc-macro-nested",
"slab",
"tokio-io",
]
[[package]] [[package]]
name = "getrandom" name = "getrandom"
version = "0.1.14" version = "0.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"libc", "libc",
"wasi", "wasi 0.9.0+wasi-snapshot-preview1",
] ]
[[package]] [[package]]
@ -935,22 +805,22 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
[[package]] [[package]]
name = "harfbuzz" name = "harfbuzz"
version = "0.3.1" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46f7426266a5ece3e49eae6f48e602c0f8c39917354a847eac9c06437dcde8da" checksum = "776caa9519beb53f697d578b6777eebd1262265c84ae797620b7f8f9b3648d91"
dependencies = [ dependencies = [
"harfbuzz-sys", "harfbuzz-sys",
] ]
[[package]] [[package]]
name = "harfbuzz-sys" name = "harfbuzz-sys"
version = "0.3.4" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "212d74cab8498b2d15700b694fb38f77562869d05e1f8b602dd05221a1ca2d63" checksum = "bf8c27ca13930dc4ffe474880040fe9e0f03c2121600dc9c95423624cab3e467"
dependencies = [ dependencies = [
"cc", "cc",
"core-graphics 0.17.3", "core-graphics 0.22.0",
"core-text 13.3.2", "core-text",
"foreign-types", "foreign-types",
"freetype", "freetype",
"pkg-config", "pkg-config",
@ -1080,9 +950,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.76" version = "0.2.77"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "755456fae044e6fa1ebbbd1b3e902ae19e73097ed4ed87bb79934a867c007bc3" checksum = "f2f96b10ec2560088a8e76961b00d47107b3a625fecb76dedb29ee7ccbf98235"
[[package]] [[package]]
name = "libloading" name = "libloading"
@ -1106,9 +976,9 @@ dependencies = [
[[package]] [[package]]
name = "libz-sys" name = "libz-sys"
version = "1.1.0" version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af67924b8dd885cccea261866c8ce5b74d239d272e154053ff927dae839f5ae9" checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655"
dependencies = [ dependencies = [
"cc", "cc",
"libc", "libc",
@ -1215,11 +1085,12 @@ dependencies = [
[[package]] [[package]]
name = "miniz_oxide" name = "miniz_oxide"
version = "0.4.1" version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d7559a8a40d0f97e1edea3220f698f78b1c5ab67532e49f68fde3910323b722" checksum = "c60c0dfe32c10b43a144bad8fc83538c52f58302c92300ea7ec7bf7b38d5a7b9"
dependencies = [ dependencies = [
"adler", "adler",
"autocfg 1.0.1",
] ]
[[package]] [[package]]
@ -1235,7 +1106,7 @@ dependencies = [
"kernel32-sys", "kernel32-sys",
"libc", "libc",
"log", "log",
"miow 0.2.1", "miow",
"net2", "net2",
"slab", "slab",
"winapi 0.2.8", "winapi 0.2.8",
@ -1253,29 +1124,6 @@ dependencies = [
"slab", "slab",
] ]
[[package]]
name = "mio-named-pipes"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656"
dependencies = [
"log",
"mio",
"miow 0.3.5",
"winapi 0.3.9",
]
[[package]]
name = "mio-uds"
version = "0.6.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0"
dependencies = [
"iovec",
"libc",
"mio",
]
[[package]] [[package]]
name = "miow" name = "miow"
version = "0.2.1" version = "0.2.1"
@ -1288,16 +1136,6 @@ dependencies = [
"ws2_32-sys", "ws2_32-sys",
] ]
[[package]]
name = "miow"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07b88fb9795d4d36d62a012dfbf49a8f5cf12751f36d31a9dbe66d528e58979e"
dependencies = [
"socket2",
"winapi 0.3.9",
]
[[package]] [[package]]
name = "mockall" name = "mockall"
version = "0.7.2" version = "0.7.2"
@ -1320,9 +1158,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a673cb441f78cd9af4f5919c28576a3cc325fb6b54e42f7047dacce3c718c17b" checksum = "a673cb441f78cd9af4f5919c28576a3cc325fb6b54e42f7047dacce3c718c17b"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"proc-macro2 1.0.19", "proc-macro2 1.0.21",
"quote 1.0.7", "quote 1.0.7",
"syn 1.0.39", "syn 1.0.40",
] ]
[[package]] [[package]]
@ -1361,7 +1199,6 @@ name = "neovide"
version = "0.6.0" version = "0.6.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait",
"cargo-husky", "cargo-husky",
"cfg-if", "cfg-if",
"derive-new", "derive-new",
@ -1374,7 +1211,7 @@ dependencies = [
"log", "log",
"lru", "lru",
"mockall", "mockall",
"nvim-rs", "neovim-lib",
"parking_lot", "parking_lot",
"rand", "rand",
"rmpv", "rmpv",
@ -1383,18 +1220,27 @@ dependencies = [
"skia-safe", "skia-safe",
"skribo", "skribo",
"skulpin", "skulpin",
"tokio",
"unicode-segmentation", "unicode-segmentation",
"which 4.0.2", "which 4.0.2",
"winapi 0.3.9", "winapi 0.3.9",
"winres", "winres",
] ]
[[package]]
name = "neovim-lib"
version = "0.6.0"
source = "git+https://github.com/kethku/neovim-lib#3a89df15c788fd0a3b28e5e15c25da88e5cdda2d"
dependencies = [
"log",
"rmpv",
"unix_socket",
]
[[package]] [[package]]
name = "net2" name = "net2"
version = "0.2.34" version = "0.2.35"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" checksum = "3ebc3ec692ed7c9a255596c67808dee269f64655d8baf7b4f0638e51ba1d6853"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"libc", "libc",
@ -1509,23 +1355,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ffa5a33ddddfee04c0283a7653987d634e880347e96b5b2ed64de07efb59db9d" checksum = "ffa5a33ddddfee04c0283a7653987d634e880347e96b5b2ed64de07efb59db9d"
dependencies = [ dependencies = [
"proc-macro-crate", "proc-macro-crate",
"proc-macro2 1.0.19", "proc-macro2 1.0.21",
"quote 1.0.7", "quote 1.0.7",
"syn 1.0.39", "syn 1.0.40",
]
[[package]]
name = "nvim-rs"
version = "0.1.1-alpha.0"
source = "git+https://github.com/kethku/nvim-rs#109feea9e345fcbb2674384b0d6914ba4b8fc61e"
dependencies = [
"async-trait",
"futures 0.3.5",
"log",
"pin-project",
"rmp",
"rmpv",
"tokio",
] ]
[[package]] [[package]]
@ -1547,12 +1379,6 @@ dependencies = [
"cc", "cc",
] ]
[[package]]
name = "once_cell"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad"
[[package]] [[package]]
name = "openssl-probe" name = "openssl-probe"
version = "0.1.2" version = "0.1.2"
@ -1636,38 +1462,6 @@ version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
[[package]]
name = "pin-project"
version = "0.4.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa"
dependencies = [
"pin-project-internal",
]
[[package]]
name = "pin-project-internal"
version = "0.4.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f"
dependencies = [
"proc-macro2 1.0.19",
"quote 1.0.7",
"syn 1.0.39",
]
[[package]]
name = "pin-project-lite"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715"
[[package]]
name = "pin-utils"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]] [[package]]
name = "pkg-config" name = "pkg-config"
version = "0.3.18" version = "0.3.18"
@ -1736,12 +1530,6 @@ version = "0.5.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99c605b9a0adc77b7211c6b1f722dcb613d68d66859a44f3d485a6da332b0598" checksum = "99c605b9a0adc77b7211c6b1f722dcb613d68d66859a44f3d485a6da332b0598"
[[package]]
name = "proc-macro-nested"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a"
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "0.4.30" version = "0.4.30"
@ -1753,9 +1541,9 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.19" version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" checksum = "36e28516df94f3dd551a587da5357459d9b36d945a7c37c3557928c1c2ff2a2c"
dependencies = [ dependencies = [
"unicode-xid 0.2.1", "unicode-xid 0.2.1",
] ]
@ -1781,7 +1569,7 @@ version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
dependencies = [ dependencies = [
"proc-macro2 1.0.19", "proc-macro2 1.0.21",
] ]
[[package]] [[package]]
@ -1867,9 +1655,9 @@ checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
[[package]] [[package]]
name = "redox_users" name = "redox_users"
version = "0.3.4" version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431" checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d"
dependencies = [ dependencies = [
"getrandom", "getrandom",
"redox_syscall", "redox_syscall",
@ -1912,13 +1700,15 @@ checksum = "ee358f3c4be83ab373cd3e501dc04881034f1ae198e73b2d9edd617653ac4293"
dependencies = [ dependencies = [
"num-traits", "num-traits",
"rmp", "rmp",
"serde",
"serde_bytes",
] ]
[[package]] [[package]]
name = "rust-argon2" name = "rust-argon2"
version = "0.7.0" version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bc8af4bda8e1ff4932523b94d3dd20ee30a87232323eda55903ffd71d2fb017" checksum = "9dab61250775933275e84053ac235621dfb739556d5c54a2f2e9313b7cf43a19"
dependencies = [ dependencies = [
"base64", "base64",
"blake2b_simd", "blake2b_simd",
@ -1945,7 +1735,7 @@ checksum = "7903c2cf599db8f310b392332f38367ca4acc84420fa1aee3536299f433c10d5"
dependencies = [ dependencies = [
"quote 1.0.7", "quote 1.0.7",
"rust-embed-utils", "rust-embed-utils",
"syn 1.0.39", "syn 1.0.40",
"walkdir", "walkdir",
] ]
@ -2044,9 +1834,9 @@ dependencies = [
[[package]] [[package]]
name = "sdl2-sys" name = "sdl2-sys"
version = "0.34.2" version = "0.34.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ed17d6d46b62b7df12134513bcc4f071268963e8c9bc8bf7ad983fbfb2bc3cc" checksum = "28d81feded049b9c14eceb4a4f6d596a98cebbd59abdba949c5552a015466d33"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"cmake", "cmake",
@ -2074,9 +1864,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.115" version = "1.0.116"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e54c9a88f2da7238af84b5101443f0c0d0a3bbdc455e34a5c9497b1903ed55d5" checksum = "96fe57af81d28386a513cbc6858332abc6117cfdb5999647c6444b8f43a370a5"
[[package]]
name = "serde_bytes"
version = "0.11.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9"
dependencies = [
"serde",
]
[[package]] [[package]]
name = "serde_json" name = "serde_json"
@ -2091,9 +1890,9 @@ dependencies = [
[[package]] [[package]]
name = "servo-fontconfig" name = "servo-fontconfig"
version = "0.4.0" version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a088f8d775a5c5314aae09bd77340bc9c67d72b9a45258be34c83548b4814cd9" checksum = "c7e3e22fe5fd73d04ebf0daa049d3efe3eae55369ce38ab16d07ddd9ac5c217c"
dependencies = [ dependencies = [
"libc", "libc",
"servo-fontconfig-sys", "servo-fontconfig-sys",
@ -2101,22 +1900,12 @@ dependencies = [
[[package]] [[package]]
name = "servo-fontconfig-sys" name = "servo-fontconfig-sys"
version = "4.0.9" version = "5.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62b3e166450f523f4db06c14f02a2d39e76d49b5d8cbd224338d93e3595c156c" checksum = "e36b879db9892dfa40f95da1c38a835d41634b825fbd8c4c418093d53c24b388"
dependencies = [ dependencies = [
"expat-sys", "expat-sys",
"pkg-config", "freetype-sys",
"servo-freetype-sys",
]
[[package]]
name = "servo-freetype-sys"
version = "4.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c4ccb6d0d32d277d3ef7dea86203d8210945eb7a45fba89dd445b3595dd0dfc"
dependencies = [
"cmake",
"pkg-config", "pkg-config",
] ]
@ -2126,16 +1915,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2"
[[package]]
name = "signal-hook-registry"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a3e12110bc539e657a646068aaf5eb5b63af9d0c1f7b29c97113fad80e15f035"
dependencies = [
"arc-swap",
"libc",
]
[[package]] [[package]]
name = "skia-bindings" name = "skia-bindings"
version = "0.32.1" version = "0.32.1"
@ -2167,7 +1946,7 @@ dependencies = [
[[package]] [[package]]
name = "skribo" name = "skribo"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/linebender/skribo#6a8d5b75c8cb6a2978974b32f1b2dcd29ce2d43a" source = "git+https://github.com/linebender/skribo#a35c876b9297f23b854b082b71b6a275b26cc18d"
dependencies = [ dependencies = [
"font-kit", "font-kit",
"harfbuzz", "harfbuzz",
@ -2179,8 +1958,8 @@ dependencies = [
[[package]] [[package]]
name = "skulpin" name = "skulpin"
version = "0.9.5" version = "0.10.0"
source = "git+https://github.com/aclysma/skulpin#f9b56db5632f10679317c3ec4e04d6985d6a63a6" source = "git+https://github.com/aclysma/skulpin?branch=master#e4abfe06f10565bcf17c57c79ad6bf626033cf9c"
dependencies = [ dependencies = [
"log", "log",
"skulpin-app-winit", "skulpin-app-winit",
@ -2191,8 +1970,8 @@ dependencies = [
[[package]] [[package]]
name = "skulpin-app-winit" name = "skulpin-app-winit"
version = "0.3.0" version = "0.4.0"
source = "git+https://github.com/aclysma/skulpin#f9b56db5632f10679317c3ec4e04d6985d6a63a6" source = "git+https://github.com/aclysma/skulpin?branch=master#e4abfe06f10565bcf17c57c79ad6bf626033cf9c"
dependencies = [ dependencies = [
"log", "log",
"skulpin-renderer", "skulpin-renderer",
@ -2201,8 +1980,8 @@ dependencies = [
[[package]] [[package]]
name = "skulpin-renderer" name = "skulpin-renderer"
version = "0.3.1" version = "0.4.0"
source = "git+https://github.com/aclysma/skulpin#f9b56db5632f10679317c3ec4e04d6985d6a63a6" source = "git+https://github.com/aclysma/skulpin?branch=master#e4abfe06f10565bcf17c57c79ad6bf626033cf9c"
dependencies = [ dependencies = [
"ash", "ash",
"log", "log",
@ -2212,8 +1991,8 @@ dependencies = [
[[package]] [[package]]
name = "skulpin-renderer-sdl2" name = "skulpin-renderer-sdl2"
version = "0.3.3" version = "0.4.0"
source = "git+https://github.com/aclysma/skulpin#f9b56db5632f10679317c3ec4e04d6985d6a63a6" source = "git+https://github.com/aclysma/skulpin?branch=master#e4abfe06f10565bcf17c57c79ad6bf626033cf9c"
dependencies = [ dependencies = [
"log", "log",
"sdl2", "sdl2",
@ -2222,8 +2001,8 @@ dependencies = [
[[package]] [[package]]
name = "skulpin-renderer-winit" name = "skulpin-renderer-winit"
version = "0.3.1" version = "0.4.0"
source = "git+https://github.com/aclysma/skulpin#f9b56db5632f10679317c3ec4e04d6985d6a63a6" source = "git+https://github.com/aclysma/skulpin?branch=master#e4abfe06f10565bcf17c57c79ad6bf626033cf9c"
dependencies = [ dependencies = [
"cocoa", "cocoa",
"log", "log",
@ -2265,9 +2044,9 @@ dependencies = [
[[package]] [[package]]
name = "socket2" name = "socket2"
version = "0.3.12" version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" checksum = "b1fa70dc5c8104ec096f4fe7ede7a221d35ae13dcd19ba1ad9a81d2cab9a1c44"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"libc", "libc",
@ -2303,20 +2082,20 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "1.0.39" version = "1.0.40"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "891d8d6567fe7c7f8835a3a98af4208f3846fba258c1bc3c31d6e506239f11f9" checksum = "963f7d3cc59b59b9325165add223142bbf1df27655d07789f109896d353d8350"
dependencies = [ dependencies = [
"proc-macro2 1.0.19", "proc-macro2 1.0.21",
"quote 1.0.7", "quote 1.0.7",
"unicode-xid 0.2.1", "unicode-xid 0.2.1",
] ]
[[package]] [[package]]
name = "tar" name = "tar"
version = "0.4.29" version = "0.4.30"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8a4c1d0bee3230179544336c15eefb563cf0302955d962e456542323e8c2e8a" checksum = "489997b7557e9a43e192c527face4feacc78bfbe6eed67fd55c4c9e381cba290"
dependencies = [ dependencies = [
"filetime", "filetime",
"libc", "libc",
@ -2357,9 +2136,9 @@ version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793" checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793"
dependencies = [ dependencies = [
"proc-macro2 1.0.19", "proc-macro2 1.0.21",
"quote 1.0.7", "quote 1.0.7",
"syn 1.0.39", "syn 1.0.40",
] ]
[[package]] [[package]]
@ -2385,11 +2164,12 @@ dependencies = [
[[package]] [[package]]
name = "time" name = "time"
version = "0.1.43" version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
dependencies = [ dependencies = [
"libc", "libc",
"wasi 0.10.0+wasi-snapshot-preview1",
"winapi 0.3.9", "winapi 0.3.9",
] ]
@ -2399,51 +2179,6 @@ version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117" checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117"
[[package]]
name = "tokio"
version = "0.2.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd"
dependencies = [
"bytes 0.5.6",
"fnv",
"iovec",
"lazy_static",
"libc",
"memchr",
"mio",
"mio-named-pipes",
"mio-uds",
"num_cpus",
"pin-project-lite",
"signal-hook-registry",
"slab",
"tokio-macros",
"winapi 0.3.9",
]
[[package]]
name = "tokio-io"
version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674"
dependencies = [
"bytes 0.4.12",
"futures 0.1.29",
"log",
]
[[package]]
name = "tokio-macros"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389"
dependencies = [
"proc-macro2 1.0.19",
"quote 1.0.7",
"syn 1.0.39",
]
[[package]] [[package]]
name = "toml" name = "toml"
version = "0.5.6" version = "0.5.6"
@ -2503,6 +2238,16 @@ dependencies = [
"regex", "regex",
] ]
[[package]]
name = "unix_socket"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6aa2700417c405c38f5e6902d699345241c28c0b7ade4abaad71e35a87eb1564"
dependencies = [
"cfg-if",
"libc",
]
[[package]] [[package]]
name = "vcpkg" name = "vcpkg"
version = "0.2.10" version = "0.2.10"
@ -2550,6 +2295,12 @@ version = "0.9.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
[[package]]
name = "wasi"
version = "0.10.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
[[package]] [[package]]
name = "wayland-client" name = "wayland-client"
version = "0.23.6" version = "0.23.6"

@ -12,7 +12,7 @@ embed-fonts = []
[dependencies] [dependencies]
euclid = "0.20.7" euclid = "0.20.7"
font-kit = "0.6.0" font-kit = "0.10.0"
skribo = { git = "https://github.com/linebender/skribo" } skribo = { git = "https://github.com/linebender/skribo" }
lru = "0.4.3" lru = "0.4.3"
skulpin = { git = "https://github.com/aclysma/skulpin", branch = "master", features = ["skulpin_sdl2"] } skulpin = { git = "https://github.com/aclysma/skulpin", branch = "master", features = ["skulpin_sdl2"] }
@ -20,9 +20,7 @@ derive-new = "0.5"
rmpv = "0.4.4" rmpv = "0.4.4"
rust-embed = { version = "5.2.0", features = ["debug-embed"] } rust-embed = { version = "5.2.0", features = ["debug-embed"] }
image = "0.22.3" image = "0.22.3"
nvim-rs = { git = "https://github.com/kethku/nvim-rs", features = [ "use_tokio" ] } neovim-lib = { git = "https://github.com/kethku/neovim-lib" }
tokio = { version = "0.2.9", features = [ "blocking", "process", "time" ] }
async-trait = "0.1.18"
lazy_static = "1.4.0" lazy_static = "1.4.0"
unicode-segmentation = "1.6.0" unicode-segmentation = "1.6.0"
log = "0.4.8" log = "0.4.8"

@ -2,29 +2,27 @@
pub mod layouts; pub mod layouts;
mod events; mod events;
mod handler;
mod ui_commands; mod ui_commands;
use std::process::Stdio; use std::process::{Stdio, Command};
use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc; use std::sync::Arc;
use std::sync::mpsc::Sender; use std::sync::mpsc::{Sender, Receiver};
use std::env; use std::env;
use std::path::Path; use std::path::Path;
use std::thread; use std::thread;
#[cfg(windows)]
use std::os::windows::process::CommandExt;
use log::{error, info, warn}; use log::{error, info, warn};
use nvim_rs::{create::tokio as create, UiAttachOptions}; use neovim_lib::{Neovim, NeovimApi, Session, UiAttachOptions};
use rmpv::Value; use rmpv::Value;
use tokio::runtime::Runtime;
use tokio::process::Command;
use tokio::sync::mpsc::{UnboundedReceiver, UnboundedSender};
use crate::error_handling::ResultPanicExplanation; use crate::error_handling::ResultPanicExplanation;
use crate::settings::*; use crate::settings::*;
use crate::window::window_geometry_or_default; use crate::window::window_geometry_or_default;
pub use events::*; pub use events::*;
use handler::NeovimHandler;
pub use layouts::*; pub use layouts::*;
pub use ui_commands::UiCommand; pub use ui_commands::UiCommand;
@ -110,29 +108,15 @@ pub fn create_nvim_command() -> Command {
cmd cmd
} }
async fn start_process(ui_command_sender: UnboundedSender<UiCommand>, mut ui_command_receiver: UnboundedReceiver<UiCommand>, redraw_event_sender: Sender<RedrawEvent>, running: Arc<AtomicBool>) { pub fn start_bridge(ui_command_sender: Sender<UiCommand>, ui_command_receiver: Receiver<UiCommand>, redraw_event_sender: Sender<RedrawEvent>, running: Arc<AtomicBool>) {
thread::spawn(move || {
let (width, height) = window_geometry_or_default(); let (width, height) = window_geometry_or_default();
let (mut nvim, io_handler, _) = let mut session = Session::new_child_cmd(&mut create_nvim_command()).unwrap_or_explained_panic("Could not locate or start neovim process");
create::new_child_cmd(&mut create_nvim_command(), NeovimHandler::new(ui_command_sender, redraw_event_sender)) let notification_receiver = session.start_event_loop_channel();
.await
.unwrap_or_explained_panic("Could not locate or start the neovim process"); let mut nvim = Neovim::new(session);
let close_watcher_running = running.clone();
tokio::spawn(async move {
info!("Close watcher started");
match io_handler.await {
Err(join_error) => error!("Error joining IO loop: '{}'", join_error),
Ok(Err(error)) => {
if !error.is_channel_closed() {
error!("Error: '{}'", error);
}
}
Ok(Ok(())) => {}
};
close_watcher_running.store(false, Ordering::Relaxed);
});
if let Ok(Value::Integer(correct_version)) = nvim.eval("has(\"nvim-0.4\")").await { if let Ok(Value::Integer(correct_version)) = nvim.eval("has(\"nvim-0.4\")") {
if correct_version.as_i64() != Some(1) { if correct_version.as_i64() != Some(1) {
error!("Neovide requires version 0.4 or higher"); error!("Neovide requires version 0.4 or higher");
std::process::exit(0); std::process::exit(0);
@ -142,19 +126,12 @@ async fn start_process(ui_command_sender: UnboundedSender<UiCommand>, mut ui_com
std::process::exit(0); std::process::exit(0);
}; };
nvim.set_var("neovide", Value::Boolean(true)) nvim.set_var("neovide", Value::Boolean(true)).unwrap_or_explained_panic("Could not communicate with neovim process");
.await if let Err(command_error) = nvim.command("runtime! ginit.vim") {
.unwrap_or_explained_panic("Could not communicate with neovim process");
let mut options = UiAttachOptions::new();
options.set_linegrid_external(true);
options.set_multigrid_external(true);
options.set_rgb(true);
if let Err(command_error) = nvim.command("runtime! ginit.vim").await {
nvim.command(&format!( nvim.command(&format!(
"echomsg \"error encountered in ginit.vim {:?}\"", "echomsg \"error encountered in ginit.vim {:?}\"",
command_error command_error
)) ))
.await
.ok(); .ok();
} }
@ -168,12 +145,10 @@ async fn start_process(ui_command_sender: UnboundedSender<UiCommand>, mut ui_com
vec![], vec![],
vec![], vec![],
) )
.await
.ok(); .ok();
let neovide_channel: u64 = nvim let neovide_channel: u64 = nvim
.list_chans() .list_chans()
.await
.ok() .ok()
.and_then(|channel_values| parse_channel_list(channel_values).ok()) .and_then(|channel_values| parse_channel_list(channel_values).ok())
.and_then(|channel_list| { .and_then(|channel_list| {
@ -200,7 +175,6 @@ async fn start_process(ui_command_sender: UnboundedSender<UiCommand>, mut ui_com
"NeovideRegisterRightClick", "NeovideRegisterRightClick",
"register_right_click", "register_right_click",
)) ))
.await
.ok(); .ok();
#[cfg(windows)] #[cfg(windows)]
@ -210,47 +184,79 @@ async fn start_process(ui_command_sender: UnboundedSender<UiCommand>, mut ui_com
"NeovideUnregisterRightClick", "NeovideUnregisterRightClick",
"unregister_right_click", "unregister_right_click",
)) ))
.await
.ok(); .ok();
NeovimApi::set_option(&mut nvim, "lazyredraw", Value::Boolean(false)).ok();
let mut options = UiAttachOptions::new();
options.set_linegrid_external(true);
options.set_multigrid_external(true);
options.set_rgb(true);
nvim.ui_attach(width as i64, height as i64, &options) nvim.ui_attach(width as i64, height as i64, &options)
.await
.unwrap_or_explained_panic("Could not attach ui to neovim process"); .unwrap_or_explained_panic("Could not attach ui to neovim process");
info!("Neovim process attached"); info!("Neovim process attached");
let nvim = Arc::new(nvim); SETTINGS.read_initial_values(&mut nvim);
let input_nvim = nvim.clone(); SETTINGS.setup_changed_listeners(&mut nvim);
let ui_command_processor_running = running.clone(); let notification_running = running.clone();
tokio::spawn(async move { thread::spawn(move || {
info!("UiCommand processor started"); loop {
while let Some(ui_command) = ui_command_receiver.recv().await { if !notification_running.load(Ordering::Relaxed) {
if !ui_command_processor_running.load(Ordering::Relaxed) { break;
return;
} }
ui_command.execute(&input_nvim).await; match notification_receiver.recv() {
} Ok((event_name, arguments)) =>
}); match event_name.as_ref() {
"redraw" => {
for events in arguments {
let parsed_events = parse_redraw_event(events)
.unwrap_or_explained_panic("Could not parse event from neovim");
SETTINGS.read_initial_values(&nvim).await; for parsed_event in parsed_events {
SETTINGS.setup_changed_listeners(&nvim).await; redraw_event_sender.send(parsed_event).ok();
}
nvim.set_option("lazyredraw", Value::Boolean(false)) }
.await }
.ok(); "setting_changed" => {
SETTINGS.handle_changed_notification(arguments);
}
#[cfg(windows)]
"neovide.register_right_click" => {
ui_command_sender.send(UiCommand::RegisterRightClick).ok();
}
#[cfg(windows)]
"neovide.unregister_right_click" => {
ui_command_sender.send(UiCommand::UnregisterRightClick).ok();
}
_ => {}
},
Err(error) => {
notification_running.store(false, Ordering::Relaxed);
break;
} }
}
}
});
pub fn start_bridge(ui_command_sender: UnboundedSender<UiCommand>, ui_command_receiver: UnboundedReceiver<UiCommand>, redraw_event_sender: Sender<RedrawEvent>, running: Arc<AtomicBool>) { let ui_command_running = running.clone();
thread::spawn(move || { thread::spawn(move || {
let runtime = Runtime::new().unwrap(); loop {
if !ui_command_running.load(Ordering::Relaxed) {
let running_clone = running.clone(); break;
runtime.spawn(async move { }
start_process(ui_command_sender, ui_command_receiver, redraw_event_sender, running_clone).await;
});
while running.load(Ordering::Relaxed) { match ui_command_receiver.recv() {
Ok(ui_command) => {
ui_command.execute(&mut nvim);
},
Err(error) => {
ui_command_running.store(false, Ordering::Relaxed);
break;
}
} }
}
});
}); });
} }

@ -1,7 +1,5 @@
use log::{error, trace}; use log::{error, trace};
use nvim_rs::compat::tokio::Compat; use neovim_lib::{Neovim, NeovimApi};
use nvim_rs::Neovim;
use tokio::process::ChildStdin;
#[cfg(windows)] #[cfg(windows)]
use crate::settings::windows_registry::{ use crate::settings::windows_registry::{
@ -40,15 +38,14 @@ pub enum UiCommand {
} }
impl UiCommand { impl UiCommand {
pub async fn execute(self, nvim: &Neovim<Compat<ChildStdin>>) { pub fn execute(self, nvim: &mut Neovim) {
match self { match self {
UiCommand::Resize { width, height } => nvim UiCommand::Resize { width, height } => nvim
.ui_try_resize(width.max(10) as i64, height.max(3) as i64) .ui_try_resize(width.max(10) as i64, height.max(3) as i64)
.await
.expect("Resize failed"), .expect("Resize failed"),
UiCommand::Keyboard(input_command) => { UiCommand::Keyboard(input_command) => {
trace!("Keyboard Input Sent: {}", input_command); trace!("Keyboard Input Sent: {}", input_command);
nvim.input(&input_command).await.expect("Input failed"); nvim.input(&input_command).expect("Input failed");
} }
UiCommand::MouseButton { UiCommand::MouseButton {
action, action,
@ -56,7 +53,6 @@ impl UiCommand {
position: (grid_x, grid_y), position: (grid_x, grid_y),
} => { } => {
nvim.input_mouse("left", &action, "", grid_id as i64, grid_y as i64, grid_x as i64) nvim.input_mouse("left", &action, "", grid_id as i64, grid_y as i64, grid_x as i64)
.await
.expect("Mouse Input Failed"); .expect("Mouse Input Failed");
} }
UiCommand::Scroll { UiCommand::Scroll {
@ -65,7 +61,6 @@ impl UiCommand {
position: (grid_x, grid_y), position: (grid_x, grid_y),
} => { } => {
nvim.input_mouse("wheel", &direction, "", grid_id as i64, grid_y as i64, grid_x as i64) nvim.input_mouse("wheel", &direction, "", grid_id as i64, grid_y as i64, grid_x as i64)
.await
.expect("Mouse Scroll Failed"); .expect("Mouse Scroll Failed");
} }
UiCommand::Drag { UiCommand::Drag {
@ -73,38 +68,35 @@ impl UiCommand {
position: (grid_x, grid_y) position: (grid_x, grid_y)
} => { } => {
nvim.input_mouse("left", "drag", "", grid_id as i64, grid_y as i64, grid_x as i64) nvim.input_mouse("left", "drag", "", grid_id as i64, grid_y as i64, grid_x as i64)
.await
.expect("Mouse Drag Failed"); .expect("Mouse Drag Failed");
} }
UiCommand::FocusLost => nvim UiCommand::FocusLost => nvim
.command("if exists('#FocusLost') | doautocmd <nomodeline> FocusLost | endif") .command("if exists('#FocusLost') | doautocmd <nomodeline> FocusLost | endif")
.await
.expect("Focus Lost Failed"), .expect("Focus Lost Failed"),
UiCommand::FocusGained => nvim UiCommand::FocusGained => nvim
.command("if exists('#FocusGained') | doautocmd <nomodeline> FocusGained | endif") .command("if exists('#FocusGained') | doautocmd <nomodeline> FocusGained | endif")
.await
.expect("Focus Gained Failed"), .expect("Focus Gained Failed"),
UiCommand::Quit => { UiCommand::Quit => {
nvim.command("qa!").await.ok(); // Ignoring result as it won't succeed since the app closed. nvim.command("qa!").ok(); // Ignoring result as it won't succeed since the app closed.
} }
UiCommand::FileDrop(path) => { UiCommand::FileDrop(path) => {
nvim.command(format!("e {}", path).as_str()).await.ok(); nvim.command(format!("e {}", path).as_str()).ok();
} }
#[cfg(windows)] #[cfg(windows)]
UiCommand::RegisterRightClick => { UiCommand::RegisterRightClick => {
if unregister_rightclick() { if unregister_rightclick() {
let msg = "Could not unregister previous menu item. Possibly already registered or not running as Admin?"; let msg = "Could not unregister previous menu item. Possibly already registered or not running as Admin?";
nvim.err_writeln(msg).await.ok(); nvim.err_writeln(msg).ok();
error!("{}", msg); error!("{}", msg);
} }
if !register_rightclick_directory() { if !register_rightclick_directory() {
let msg = "Could not register directory context menu item. Possibly already registered or not running as Admin?"; let msg = "Could not register directory context menu item. Possibly already registered or not running as Admin?";
nvim.err_writeln(msg).await.ok(); nvim.err_writeln(msg).ok();
error!("{}", msg); error!("{}", msg);
} }
if !register_rightclick_file() { if !register_rightclick_file() {
let msg = "Could not register file context menu item. Possibly already registered or not running as Admin?"; let msg = "Could not register file context menu item. Possibly already registered or not running as Admin?";
nvim.err_writeln(msg).await.ok(); nvim.err_writeln(msg).ok();
error!("{}", msg); error!("{}", msg);
} }
} }
@ -112,7 +104,7 @@ impl UiCommand {
UiCommand::UnregisterRightClick => { UiCommand::UnregisterRightClick => {
if !unregister_rightclick() { if !unregister_rightclick() {
let msg = "Could not remove context menu items. Possibly already removed or not running as Admin?"; let msg = "Could not remove context menu items. Possibly already removed or not running as Admin?";
nvim.err_writeln(msg).await.ok(); nvim.err_writeln(msg).ok();
error!("{}", msg); error!("{}", msg);
} }
} }

@ -23,8 +23,6 @@ use std::sync::atomic::AtomicBool;
use std::sync::mpsc::channel; use std::sync::mpsc::channel;
use std::process; use std::process;
use tokio::sync::mpsc::unbounded_channel;
use window::window_geometry; use window::window_geometry;
use bridge::start_bridge; use bridge::start_bridge;
@ -135,7 +133,7 @@ fn main() {
let (redraw_event_sender, redraw_event_receiver) = channel(); let (redraw_event_sender, redraw_event_receiver) = channel();
let (draw_command_sender, draw_command_receiver) = channel(); let (draw_command_sender, draw_command_receiver) = channel();
let (ui_command_sender, ui_command_receiver) = unbounded_channel(); let (ui_command_sender, ui_command_receiver) = channel();
start_bridge(ui_command_sender.clone(), ui_command_receiver, redraw_event_sender, running.clone()); start_bridge(ui_command_sender.clone(), ui_command_receiver, redraw_event_sender, running.clone());
start_editor(redraw_event_receiver, draw_command_sender); start_editor(redraw_event_receiver, draw_command_sender);

@ -5,16 +5,13 @@ use std::convert::TryInto;
#[cfg(not(test))] #[cfg(not(test))]
use flexi_logger::{Cleanup, Criterion, Duplicate, Logger, Naming}; use flexi_logger::{Cleanup, Criterion, Duplicate, Logger, Naming};
use log::warn; use log::warn;
use nvim_rs::compat::tokio::Compat; use neovim_lib::{Neovim, NeovimApi};
use nvim_rs::Neovim;
use parking_lot::RwLock; use parking_lot::RwLock;
pub use rmpv::Value; pub use rmpv::Value;
mod from_value; mod from_value;
pub use from_value::FromValue; pub use from_value::FromValue;
pub mod windows_registry; pub mod windows_registry;
use tokio::process::ChildStdin;
use crate::error_handling::ResultPanicExplanation; use crate::error_handling::ResultPanicExplanation;
lazy_static! { lazy_static! {
@ -141,25 +138,25 @@ impl Settings {
(*value).clone() (*value).clone()
} }
pub async fn read_initial_values(&self, nvim: &Neovim<Compat<ChildStdin>>) { pub fn read_initial_values(&self, nvim: &mut Neovim) {
let keys: Vec<String> = self.listeners.read().keys().cloned().collect(); let keys: Vec<String> = self.listeners.read().keys().cloned().collect();
for name in keys { for name in keys {
let variable_name = format!("neovide_{}", name.to_string()); let variable_name = format!("neovide_{}", name.to_string());
match nvim.get_var(&variable_name).await { match nvim.get_var(&variable_name) {
Ok(value) => { Ok(value) => {
self.listeners.read().get(&name).unwrap()(value); self.listeners.read().get(&name).unwrap()(value);
} }
Err(error) => { Err(error) => {
warn!("Initial value load failed for {}: {}", name, error); warn!("Initial value load failed for {}: {}", name, error);
let setting = self.readers.read().get(&name).unwrap()(); let setting = self.readers.read().get(&name).unwrap()();
nvim.set_var(&variable_name, setting).await.ok(); nvim.set_var(&variable_name, setting).ok();
} }
} }
} }
} }
pub async fn setup_changed_listeners(&self, nvim: &Neovim<Compat<ChildStdin>>) { pub fn setup_changed_listeners(&self, nvim: &mut Neovim) {
let keys: Vec<String> = self.listeners.read().keys().cloned().collect(); let keys: Vec<String> = self.listeners.read().keys().cloned().collect();
for name in keys { for name in keys {
@ -174,7 +171,6 @@ impl Settings {
name name
); );
nvim.command(&vimscript) nvim.command(&vimscript)
.await
.unwrap_or_explained_panic(&format!( .unwrap_or_explained_panic(&format!(
"Could not setup setting notifier for {}", "Could not setup setting notifier for {}",
name name

@ -2,7 +2,7 @@ use std::thread::sleep;
use std::time::{Duration, Instant}; use std::time::{Duration, Instant};
use std::sync::Arc; use std::sync::Arc;
use std::sync::atomic::{Ordering, AtomicBool}; use std::sync::atomic::{Ordering, AtomicBool};
use std::sync::mpsc::Receiver; use std::sync::mpsc::{Sender, Receiver};
use log::{debug, error, info, trace}; use log::{debug, error, info, trace};
use skulpin::sdl2; use skulpin::sdl2;
@ -15,7 +15,6 @@ use skulpin::{
CoordinateSystem, LogicalSize, PhysicalSize, PresentMode, Renderer as SkulpinRenderer, CoordinateSystem, LogicalSize, PhysicalSize, PresentMode, Renderer as SkulpinRenderer,
RendererBuilder, Sdl2Window, Window, RendererBuilder, Sdl2Window, Window,
}; };
use tokio::sync::mpsc::UnboundedSender;
use crate::editor::DrawCommand; use crate::editor::DrawCommand;
use crate::bridge::{produce_neovim_keybinding_string, UiCommand}; use crate::bridge::{produce_neovim_keybinding_string, UiCommand};
@ -38,7 +37,7 @@ fn windows_fix_dpi() {
} }
} }
fn handle_new_grid_size(new_size: LogicalSize, renderer: &Renderer, ui_command_sender: &UnboundedSender<UiCommand>) { fn handle_new_grid_size(new_size: LogicalSize, renderer: &Renderer, ui_command_sender: &Sender<UiCommand>) {
if new_size.width > 0 && new_size.height > 0 { if new_size.width > 0 && new_size.height > 0 {
let new_width = ((new_size.width + 1) as f32 / renderer.font_width) as u32; let new_width = ((new_size.width + 1) as f32 / renderer.font_width) as u32;
let new_height = ((new_size.height + 1) as f32 / renderer.font_height) as u32; let new_height = ((new_size.height + 1) as f32 / renderer.font_height) as u32;
@ -65,7 +64,7 @@ struct WindowWrapper {
fullscreen: bool, fullscreen: bool,
cached_size: (u32, u32), cached_size: (u32, u32),
cached_position: (i32, i32), cached_position: (i32, i32),
ui_command_sender: UnboundedSender<UiCommand>, ui_command_sender: Sender<UiCommand>,
running: Arc<AtomicBool> running: Arc<AtomicBool>
} }
@ -112,7 +111,7 @@ pub fn window_geometry_or_default() -> (u64, u64) {
} }
impl WindowWrapper { impl WindowWrapper {
pub fn new(ui_command_sender: UnboundedSender<UiCommand>, running: Arc<AtomicBool>) -> WindowWrapper { pub fn new(ui_command_sender: Sender<UiCommand>, running: Arc<AtomicBool>) -> WindowWrapper {
let context = sdl2::init().expect("Failed to initialize sdl2"); let context = sdl2::init().expect("Failed to initialize sdl2");
let video_subsystem = context let video_subsystem = context
.video() .video()
@ -436,7 +435,7 @@ pub fn initialize_settings() {
register_nvim_setting!("fullscreen", WindowSettings::fullscreen); register_nvim_setting!("fullscreen", WindowSettings::fullscreen);
} }
pub fn start_window(draw_command_receiver: Receiver<DrawCommand>, ui_command_sender: UnboundedSender<UiCommand>, running: Arc<AtomicBool>) { pub fn start_window(draw_command_receiver: Receiver<DrawCommand>, ui_command_sender: Sender<UiCommand>, running: Arc<AtomicBool>) {
let mut window = WindowWrapper::new(ui_command_sender.clone(), running.clone()); let mut window = WindowWrapper::new(ui_command_sender.clone(), running.clone());
info!("Starting window event loop"); info!("Starting window event loop");

Loading…
Cancel
Save