Merge branch 'master' into ext_cmdline

This commit is contained in:
daa 2018-01-01 17:56:10 +03:00
commit 0b2fc12c4e
39 changed files with 996 additions and 679 deletions

531
Cargo.lock generated
View File

@ -1,65 +1,36 @@
[root]
name = "nvim-gtk"
version = "0.2.0"
dependencies = [
"cairo-rs 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gio 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gtk 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gtk-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"htmlescape 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"neovim-lib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pango 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pango-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pangocairo 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
"phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
"rmpv 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "aho-corasick" name = "aho-corasick"
version = "0.6.3" version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "atk-sys" name = "atk-sys"
version = "0.4.0" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gobject-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]]
name = "bitflags"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "bitflags" name = "bitflags"
version = "0.9.1" version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "bitflags"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "byteorder" name = "byteorder"
version = "1.1.0" version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
@ -69,23 +40,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "cairo-rs" name = "cairo-rs"
version = "0.2.0" version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"c_vec 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "c_vec 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cairo-sys-rs 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "cairo-sys-rs 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "cairo-sys-rs" name = "cairo-sys-rs"
version = "0.4.0" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -95,19 +66,6 @@ name = "cfg-if"
version = "0.1.2" version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "conv"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"custom_derive 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "custom_derive"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "dtoa" name = "dtoa"
version = "0.4.2" version = "0.4.2"
@ -118,164 +76,178 @@ name = "env_logger"
version = "0.4.3" version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "gdk" name = "fuchsia-zircon"
version = "0.6.0" version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cairo-rs 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-zircon-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"cairo-sys-rs 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ]
"gdk-pixbuf 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", [[package]]
"gio 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", name = "fuchsia-zircon-sys"
"glib 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", version = "0.3.2"
"glib-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", source = "registry+https://github.com/rust-lang/crates.io-index"
"gobject-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", [[package]]
"pango 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", name = "gdk"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cairo-rs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cairo-sys-rs 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk-pixbuf 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gio 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
"pango 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "gdk-pixbuf" name = "gdk-pixbuf"
version = "0.2.0" version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"gdk-pixbuf-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gdk-pixbuf-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gobject-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "gdk-pixbuf-sys" name = "gdk-pixbuf-sys"
version = "0.4.0" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"gio-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gio-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gobject-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "gdk-sys" name = "gdk-sys"
version = "0.4.0" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cairo-sys-rs 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "cairo-sys-rs 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk-pixbuf-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gdk-pixbuf-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gio-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gio-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gobject-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
"pango-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "pango-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "gio" name = "gio"
version = "0.2.0" version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"gio-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gio-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gobject-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "gio-sys" name = "gio-sys"
version = "0.4.0" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gobject-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "glib" name = "glib"
version = "0.3.0" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gobject-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "glib-sys" name = "glib-sys"
version = "0.4.0" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "gobject-sys" name = "gobject-sys"
version = "0.4.0" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "gtk" name = "gtk"
version = "0.2.0" version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cairo-rs 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "cairo-rs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cairo-sys-rs 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "cairo-sys-rs 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "gdk 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk-pixbuf 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "gdk-pixbuf 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk-pixbuf-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gdk-pixbuf-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gdk-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gio 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "gio 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gio-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gio-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gobject-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gtk-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gtk-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
"pango 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "pango 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "gtk-sys" name = "gtk-sys"
version = "0.4.0" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"atk-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "atk-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cairo-sys-rs 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "cairo-sys-rs 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk-pixbuf-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gdk-pixbuf-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gdk-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gio-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gio-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gobject-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
"pango-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "pango-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -291,42 +263,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "lazy_static" name = "lazy_static"
version = "0.2.8" version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "lazy_static"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.29" version = "0.2.34"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "log" name = "log"
version = "0.3.8" version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "magenta"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"conv 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"magenta-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "magenta-sys" name = "log"
version = "0.1.1" version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "memchr" name = "memchr"
version = "1.0.1" version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -334,65 +305,99 @@ name = "neovim-lib"
version = "0.5.0" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"rmp 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)", "rmp 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)",
"rmpv 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rmpv 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"unix_socket 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "unix_socket 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "num-traits" name = "num-traits"
version = "0.1.40" version = "0.1.41"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "pango" name = "nvim-gtk"
version = "0.2.0" version = "0.2.0"
dependencies = [
"cairo-rs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gio 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gtk 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gtk-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"htmlescape 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"neovim-lib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pango 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pango-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pangocairo 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"pangocairo-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
"phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
"rmpv 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "pango"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"glib 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gobject-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
"pango-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "pango-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "pango-sys" name = "pango-sys"
version = "0.4.0" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gobject-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "pangocairo" name = "pangocairo"
version = "0.2.0" version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"cairo-rs 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
"glib 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "cairo-rs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "cairo-sys-rs 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pango 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pango-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "gobject-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pangocairo-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
"pango 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pango-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pangocairo-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "pangocairo-sys" name = "pangocairo-sys"
version = "0.4.0" version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"cairo-sys-rs 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "cairo-sys-rs 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pango-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
"pango-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -419,7 +424,7 @@ version = "0.7.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", "phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -442,37 +447,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "rand" name = "rand"
version = "0.3.16" version = "0.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-zircon 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"magenta 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "regex" name = "regex"
version = "0.2.2" version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex-syntax 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "regex-syntax" name = "regex-syntax"
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"
[[package]] [[package]]
name = "rmp" name = "rmp"
version = "0.8.6" version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -480,38 +485,38 @@ name = "rmpv"
version = "0.4.0" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)",
"rmp 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)", "rmp 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_bytes 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde_bytes 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.11" version = "1.0.27"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "serde_bytes" name = "serde_bytes"
version = "0.10.2" version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"serde 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.11" version = "1.0.27"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive_internals 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "serde_derive_internals" name = "serde_derive_internals"
version = "0.15.1" version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
@ -520,13 +525,13 @@ dependencies = [
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.5" version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -554,10 +559,10 @@ dependencies = [
[[package]] [[package]]
name = "thread_local" name = "thread_local"
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"
dependencies = [ dependencies = [
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -566,7 +571,7 @@ name = "toml"
version = "0.4.5" version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"serde 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -580,7 +585,7 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -607,64 +612,64 @@ version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[metadata] [metadata]
"checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699" "checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4"
"checksum atk-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c69658a4e18d5c9575f716e24559645d08a4044d6946c30c2e0025952c84d842" "checksum atk-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "33a67fd81e1922dddc335887516f2f5254534e89c9d39fa89bca5d79bd150d34"
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5"
"checksum byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff81738b726f5d099632ceaffe7fb65b90212e8dce59d518729e7e8634032d3d" "checksum bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c30d3802dfb7281680d6285f2ccdaa8c2d8fee41f93805dba5c4cf50dc23cf"
"checksum byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "652805b7e73fada9d85e9a6682a4abd490cb52d96aeecc12e33a0de34dfd0d23"
"checksum c_vec 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6237ac5a4b1e81c213c24c6437964c61e646df910a914b4ab1487b46df20bd13" "checksum c_vec 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6237ac5a4b1e81c213c24c6437964c61e646df910a914b4ab1487b46df20bd13"
"checksum cairo-rs 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9d336f1b2ff46c17475a14360de7f456707008da475c54824887e52e453ab00" "checksum cairo-rs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6b5695f59fd036fe5741bc5a4eb20c78fbe42256e3b08a2af26bbcbe8070bf3"
"checksum cairo-sys-rs 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9e8a1e2a76ac09b959788c2c30a355d693ce6f7f7d7268f6d1dd5d8c3359c521" "checksum cairo-sys-rs 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c6e18fecaeac51809db57f45f4553cc0975225a7eb435a7a7e91e5e8113a84d"
"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de" "checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"
"checksum conv 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "78ff10625fd0ac447827aa30ea8b861fead473bb60aeb73af6c1c58caf0d1299"
"checksum custom_derive 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9"
"checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab" "checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab"
"checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b" "checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b"
"checksum gdk 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f30018ecbbb1e6f1d59c4024ec08675850744b799abc5420be0629ac9ba0abd2" "checksum fuchsia-zircon 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bd510087c325af53ba24f3be8f1c081b0982319adcb8b03cad764512923ccc19"
"checksum gdk-pixbuf 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "caf05dab73febcc6e90abaff8f24cfe1cf1bd2222cd648ddfe337bf3b994489f" "checksum fuchsia-zircon-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "08b3a6f13ad6b96572b53ce7af74543132f1a7055ccceb6d073dd36c54481859"
"checksum gdk-pixbuf-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "85eb441420653b33e5a29d13227ea34995383e65bf4f33b16492ec95e44a8996" "checksum gdk 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e51db95be6565011bcd5cd99f9b17fdd585001057a999b21e09f1e8c28deb9"
"checksum gdk-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "679d86da2a4522a623e3ce4b67f2126a12e057a1f7269eee7028199f78b5a854" "checksum gdk-pixbuf 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "16160d212ae91abe9f3324c3fb233929ba322dde63585d15cda3336f8c529ed1"
"checksum gio 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b7bc3126c94109e65871e4228b990d1ea2953259483d5b06eb96e8b36a7bf196" "checksum gdk-pixbuf-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "798f97101eea8180da363d0e80e07ec7ec6d1809306601c0100c1de5bc8b4f52"
"checksum gio-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "189969f8189604c371d42b613d928c9d17fcfbf6e175d6b0ce9475a950f76dc6" "checksum gdk-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4ee916f5f25c5f4b21bd9dcb12a216ae697406940ff9476358c308a8ececada"
"checksum glib 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67eb5b7251562f527d55d0ccf81bc5e6e75045df38b97cfee98ee7b2fc5aa7c0" "checksum gio 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "84ba5a2beb559059a0c9c2bd3681743cdede8d9a36c775840bca800333b22867"
"checksum glib-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cdd7d911c5dc610aabe37caae7d3b9d2cfe6d8f4c85ff4c062f3d6f490e75067" "checksum gio-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a303bbf7a5e75ab3b627117ff10e495d1b9e97e1d68966285ac2b1f6270091bc"
"checksum gobject-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "edc95561e538381576425264a4ddd08c65d5da218f10b2a47b4479dd147775da" "checksum glib 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "450247060df7d52fdad31e1d66f30d967e925c9d1d26a0ae050cfe33dcd00d08"
"checksum gtk 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce17f98e7dcdc9d06b3a5f7621d796a24937c04953481205b1be267c5a02697a" "checksum glib-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9693049613ff52b93013cc3d2590366d8e530366d288438724b73f6c7dc4be8"
"checksum gtk-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "854b56ce6d6b05945f7735651482835c5ac1f8582142ce67306726259a3dafb0" "checksum gobject-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60d507c87a71b1143c66ed21a969be9b99a76df234b342d733e787e6c9c7d7c2"
"checksum gtk 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0847c507e52c1feaede13ef56fb4847742438602655449d5f1f782e8633f146f"
"checksum gtk-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "905fcfbaaad1b44ec0b4bba9e4d527d728284c62bc2ba41fccedace2b096766f"
"checksum htmlescape 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e9025058dae765dee5070ec375f591e2ba14638c63feff74f13805a72e523163" "checksum htmlescape 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e9025058dae765dee5070ec375f591e2ba14638c63feff74f13805a72e523163"
"checksum itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8324a32baf01e2ae060e9de58ed0bc2320c9a2833491ee36cd3b4c414de4db8c" "checksum itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8324a32baf01e2ae060e9de58ed0bc2320c9a2833491ee36cd3b4c414de4db8c"
"checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" "checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73"
"checksum libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)" = "8a014d9226c2cc402676fbe9ea2e15dd5222cd1dd57f576b5b283178c944a264" "checksum lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d"
"checksum log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "880f77541efa6e5cc74e76910c9884d9859683118839d6a1dc3b11e63512565b" "checksum libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)" = "36fbc8a8929c632868295d0178dd8f63fc423fd7537ad0738372bd010b3ac9b0"
"checksum magenta 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4bf0336886480e671965f794bc9b6fce88503563013d1bfb7a502c81fe3ac527" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b"
"checksum magenta-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40d014c7011ac470ae28e2f76a02bfea4a8480f73e701353b49ad7a8d75f4699" "checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2"
"checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" "checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d"
"checksum neovim-lib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1889b79fccec66b11f3f9d3a266ffd97c0944af82a62843ca2b9529fedd82fec" "checksum neovim-lib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1889b79fccec66b11f3f9d3a266ffd97c0944af82a62843ca2b9529fedd82fec"
"checksum num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "99843c856d68d8b4313b03a17e33c4bb42ae8f6610ea81b28abe076ac721b9b0" "checksum num-traits 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "cacfcab5eb48250ee7d0c7896b51a2c5eec99c1feea5f32025635f5ae4b00070"
"checksum pango 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5afa4b4c5380315b12075e7767d9bdd62d53beeb6087d9287ef6990e57a6b643" "checksum pango 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e81c404ab81ea7ea2fc2431a0a7672507b80e4b8bf4b41eac3fc83cc665104e"
"checksum pango-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e6ec8d90306b5ff43f5836f4363267ea95be02b3df71d2b31ba8fbb1680bdee1" "checksum pango-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34f34a1be107fe16abb2744e0e206bee4b3b07460b5fddd3009a6aaf60bd69ab"
"checksum pangocairo 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c8edeb86f36f8f10a252a888fa3d9aff4d0681373da918c207eac2208aa091e6" "checksum pangocairo 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "41a8620ece55098d741bacf4d3aa52398f85ce83cfe0d8f670fa11de88f52c40"
"checksum pangocairo-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c26c200ef32a682bf8b693b47996c3c33e0b2de32b30f7251cc60673ad513bef" "checksum pangocairo-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e34ec010b38a2a6dafdf3d86ffe1251a0ae759208ec85f78c66c0445481bd5a8"
"checksum phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "cb325642290f28ee14d8c6201159949a872f220c62af6e110a56ea914fbe42fc" "checksum phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "cb325642290f28ee14d8c6201159949a872f220c62af6e110a56ea914fbe42fc"
"checksum phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d62594c0bb54c464f633175d502038177e90309daf2e0158be42ed5f023ce88f" "checksum phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d62594c0bb54c464f633175d502038177e90309daf2e0158be42ed5f023ce88f"
"checksum phf_generator 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "6b07ffcc532ccc85e3afc45865469bf5d9e4ef5bfcf9622e3cfe80c2d275ec03" "checksum phf_generator 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "6b07ffcc532ccc85e3afc45865469bf5d9e4ef5bfcf9622e3cfe80c2d275ec03"
"checksum phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "07e24b0ca9643bdecd0632f2b3da6b1b89bbb0030e0b992afc1113b23a7bc2f2" "checksum phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "07e24b0ca9643bdecd0632f2b3da6b1b89bbb0030e0b992afc1113b23a7bc2f2"
"checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" "checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903"
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
"checksum rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "eb250fd207a4729c976794d03db689c9be1d634ab5a1c9da9492a13d8fecbcdf" "checksum rand 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)" = "9e7944d95d25ace8f377da3ac7068ce517e4c646754c43a1b1849177bbf72e59"
"checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b" "checksum regex 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "744554e01ccbd98fff8c457c3b092cd67af62a555a43bfe97ae8a0451f7799fa"
"checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db" "checksum regex-syntax 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8e931c58b93d86f080c734bfd2bce7dd0079ae2331235818133c8be7f422e20e"
"checksum rmp 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7ce560a5728f4eec697f07f8d7fa20608893d44b4f5b8f9f5f51a2987f3cffe2" "checksum rmp 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a3d45d7afc9b132b34a2479648863aa95c5c88e98b32285326a6ebadc80ec5c9"
"checksum rmpv 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "29af0205707de955a396a1d3c657677c65f791ebabb63c0596c0b2fec0bf6325" "checksum rmpv 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "29af0205707de955a396a1d3c657677c65f791ebabb63c0596c0b2fec0bf6325"
"checksum serde 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "f7726f29ddf9731b17ff113c461e362c381d9d69433f79de4f3dd572488823e9" "checksum serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)" = "db99f3919e20faa51bb2996057f5031d8685019b5a06139b1ce761da671b8526"
"checksum serde_bytes 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5a35acc737295444cf7eb136236563f13dcddbfef65ac00d07870b590df77ed5" "checksum serde_bytes 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)" = "52b678af90a3aebc4484c22d639bf374eb7d598988edb33fa73c4febd6046a59"
"checksum serde_derive 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "cf823e706be268e73e7747b147aa31c8f633ab4ba31f115efb57e5047c3a76dd" "checksum serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)" = "f4ba7591cfe93755e89eeecdbcc668885624829b020050e6aec99c2a03bd3fd0"
"checksum serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37aee4e0da52d801acfbc0cc219eb1eda7142112339726e427926a6f6ee65d3a" "checksum serde_derive_internals 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6e03f1c9530c3fb0a0a5c9b826bdd9246a5921ae995d75f512ac917fc4dd55b5"
"checksum serde_json 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ae1e67ce320daa7e494c578e34d4b00689f23bb94512fe0ca0dfaf02ea53fb67" "checksum serde_json 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c9db7266c7d63a4c4b7fe8719656ccdd51acf1bed6124b174f933b009fb10bcb"
"checksum siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0df90a788073e8d0235a67e50441d47db7c8ad9debd91cbf43736a2a92d36537" "checksum siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0df90a788073e8d0235a67e50441d47db7c8ad9debd91cbf43736a2a92d36537"
"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad"
"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" "checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6"
"checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14" "checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963"
"checksum toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a7540f4ffc193e0d3c94121edb19b055670d369f77d5804db11ae053a45b6e7e" "checksum toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a7540f4ffc193e0d3c94121edb19b055670d369f77d5804db11ae053a45b6e7e"
"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" "checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
"checksum unix_socket 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6aa2700417c405c38f5e6902d699345241c28c0b7ade4abaad71e35a87eb1564" "checksum unix_socket 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6aa2700417c405c38f5e6902d699345241c28c0b7ade4abaad71e35a87eb1564"

View File

@ -5,16 +5,17 @@ authors = ["daa84 <daa84@inbox.ru>"]
build = "build.rs" build = "build.rs"
[dependencies] [dependencies]
cairo-rs = "0.2" cairo-rs = "0.3"
pango = "0.2" pango = "0.3"
pango-sys = "0.4" pango-sys = "0.5"
pangocairo = "0.2" pangocairo = "0.4"
glib = "0.3" pangocairo-sys = "0.6"
glib-sys = "0.4" glib = "0.4"
gdk = "0.6" glib-sys = "0.5"
gdk-sys = "0.4" gdk = "0.7"
gio = "0.2" gdk-sys = "0.5"
gobject-sys = "0.4" gio = "0.3"
gobject-sys = "0.5"
#gdk = { git = 'https://github.com/gtk-rs/gdk' } #gdk = { git = 'https://github.com/gtk-rs/gdk' }
#gdk-sys = { git = 'https://github.com/gtk-rs/sys' } #gdk-sys = { git = 'https://github.com/gtk-rs/sys' }
#glib = { git = 'https://github.com/gtk-rs/glib' } #glib = { git = 'https://github.com/gtk-rs/glib' }
@ -27,7 +28,7 @@ gobject-sys = "0.4"
#pangocairo = { git = 'https://github.com/RazrFalcon/pangocairo-rs' } #pangocairo = { git = 'https://github.com/RazrFalcon/pangocairo-rs' }
neovim-lib = "0.5" neovim-lib = "0.5"
phf = "0.7" phf = "0.7"
log = "0.3" log = "0.4"
env_logger = "0.4" env_logger = "0.4"
htmlescape = "0.3" htmlescape = "0.3"
rmpv = "0.4" rmpv = "0.4"
@ -44,12 +45,12 @@ serde_json = "1.0"
phf_codegen = "0.7" phf_codegen = "0.7"
[dependencies.gtk] [dependencies.gtk]
version = "0.2" version = "0.3"
features = ["v3_22"] features = ["v3_22"]
#git = "https://github.com/gtk-rs/gtk" #git = "https://github.com/gtk-rs/gtk"
[dependencies.gtk-sys] [dependencies.gtk-sys]
version = "0.4" version = "0.5"
features = ["v3_22"] features = ["v3_22"]
#git = 'https://github.com/gtk-rs/sys' #git = 'https://github.com/gtk-rs/sys'

View File

@ -15,8 +15,10 @@ install-resources:
mkdir -p $(PREFIX)/share/applications/ mkdir -p $(PREFIX)/share/applications/
cp desktop/org.daa.NeovimGtk.desktop $(PREFIX)/share/applications/ cp desktop/org.daa.NeovimGtk.desktop $(PREFIX)/share/applications/
sed -i "s|Exec=nvim-gtk|Exec=$(PREFIX)/bin/nvim-gtk|" $(PREFIX)/share/applications/org.daa.NeovimGtk.desktop sed -i "s|Exec=nvim-gtk|Exec=$(PREFIX)/bin/nvim-gtk|" $(PREFIX)/share/applications/org.daa.NeovimGtk.desktop
mkdir -p $(PREFIX)/share/icons/hicolor/128x128/apps/ mkdir -p $(PREFIX)/share/icons/hicolor/48x48/apps/
cp desktop/org.daa.NeovimGtk.png $(PREFIX)/share/icons/hicolor/128x128/apps/ cp desktop/org.daa.NeovimGtk.png $(PREFIX)/share/icons/hicolor/48x48/apps/
mkdir -p $(PREFIX)/share/icons/hicolor/scalable/apps/
cp desktop/org.daa.NeovimGtk.svg $(PREFIX)/share/icons/hicolor/scalable/apps/
mkdir -p $(PREFIX)/share/fonts/ mkdir -p $(PREFIX)/share/fonts/
cp -n desktop/dejavu_font/*.ttf $(PREFIX)/share/fonts/ cp -n desktop/dejavu_font/*.ttf $(PREFIX)/share/fonts/
fc-cache -fv fc-cache -fv

View File

@ -13,11 +13,6 @@ call rpcnotify(1, 'Gui', 'Font', 'DejaVu Sans Mono 12')
``` ```
for more details see [wiki](https://github.com/daa84/neovim-gtk/wiki/Configuration) for more details see [wiki](https://github.com/daa84/neovim-gtk/wiki/Configuration)
# Command line
* pass nvim custom execution path (by default used `nvim` command)
```
cargo run -- --nvim-bin-path=E:\Neovim\bin\nvim.exe
```
# Install # Install
## From sources ## From sources
By default to `/usr/local`: By default to `/usr/local`:

View File

@ -7,3 +7,4 @@ Type=Application
Terminal=false Terminal=false
Categories=GTK;Utility;TextEditor; Categories=GTK;Utility;TextEditor;
StartupNotify=true StartupNotify=true
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -64,20 +64,6 @@ impl ColorModel {
} }
} }
pub fn cell_colors<'a>(&'a self, cell: &'a Cell) -> (Option<&'a Color>, &'a Color) {
if !cell.attrs.reverse {
(
cell.attrs.background.as_ref(),
cell.attrs.foreground.as_ref().unwrap_or(&self.fg_color),
)
} else {
(
cell.attrs.foreground.as_ref().or(Some(&self.fg_color)),
cell.attrs.background.as_ref().unwrap_or(&self.bg_color),
)
}
}
pub fn cell_fg<'a>(&'a self, cell: &'a Cell) -> Option<&'a Color> { pub fn cell_fg<'a>(&'a self, cell: &'a Cell) -> Option<&'a Color> {
if !cell.attrs.reverse { if !cell.attrs.reverse {
cell.attrs.foreground.as_ref() cell.attrs.foreground.as_ref()

View File

@ -63,9 +63,8 @@ impl <CB: CursorRedrawCb> State <CB> {
fn reset_to(&mut self, phase: AnimPhase) { fn reset_to(&mut self, phase: AnimPhase) {
self.alpha = Alpha(1.0); self.alpha = Alpha(1.0);
self.anim_phase = phase; self.anim_phase = phase;
if let Some(timer_id) = self.timer { if let Some(timer_id) = self.timer.take() {
glib::source_remove(timer_id); glib::source_remove(timer_id);
self.timer = None;
} }
} }
} }
@ -257,7 +256,7 @@ fn anim_step<CB: CursorRedrawCb + 'static> (state: &Arc<UiMutex<State<CB>>>) ->
impl <CB: CursorRedrawCb> Drop for Cursor<CB> { impl <CB: CursorRedrawCb> Drop for Cursor<CB> {
fn drop(&mut self) { fn drop(&mut self) {
if let Some(timer_id) = self.state.borrow().timer { if let Some(timer_id) = self.state.borrow_mut().timer.take() {
glib::source_remove(timer_id); glib::source_remove(timer_id);
} }
} }

View File

@ -30,4 +30,3 @@ fn get_xdg_config_dir() -> Result<PathBuf, String> {
home_dir.push(".config"); home_dir.push(".config");
Ok(home_dir) Ok(home_dir)
} }

View File

@ -20,8 +20,8 @@ impl ErrorArea {
let label = gtk::Label::new(None); let label = gtk::Label::new(None);
label.set_line_wrap(true); label.set_line_wrap(true);
let error_image = gtk::Image::new_from_icon_name("dialog-error", let error_image =
gtk_sys::GTK_ICON_SIZE_DIALOG as i32); gtk::Image::new_from_icon_name("dialog-error", gtk_sys::GTK_ICON_SIZE_DIALOG as i32);
base.pack_start(&error_image, false, true, 10); base.pack_start(&error_image, false, true, 10);
base.pack_start(&label, true, true, 1); base.pack_start(&label, true, true, 1);

View File

@ -18,8 +18,9 @@ pub fn keyval_to_input_string(in_str: &str, in_state: gdk::ModifierType) -> Stri
debug!("keyval -> {}", in_str); debug!("keyval -> {}", in_str);
// CTRL-^ and CTRL-@ don't work in the normal way. // CTRL-^ and CTRL-@ don't work in the normal way.
if state.contains(gdk::CONTROL_MASK) && !state.contains(gdk::SHIFT_MASK) && if state.contains(gdk::ModifierType::CONTROL_MASK) && !state.contains(gdk::ModifierType::SHIFT_MASK) &&
!state.contains(gdk::MOD1_MASK) { !state.contains(gdk::ModifierType::MOD1_MASK)
{
if val == "6" { if val == "6" {
val = "^"; val = "^";
} else if val == "2" { } else if val == "2" {
@ -34,7 +35,7 @@ pub fn keyval_to_input_string(in_str: &str, in_state: gdk::ModifierType) -> Stri
// Remove SHIFT // Remove SHIFT
if ch.is_ascii() && !ch.is_alphanumeric() { if ch.is_ascii() && !ch.is_alphanumeric() {
state.remove(gdk::SHIFT_MASK); state.remove(gdk::ModifierType::SHIFT_MASK);
} }
} }
@ -42,13 +43,13 @@ pub fn keyval_to_input_string(in_str: &str, in_state: gdk::ModifierType) -> Stri
val = "lt"; val = "lt";
} }
if state.contains(gdk::SHIFT_MASK) { if state.contains(gdk::ModifierType::SHIFT_MASK) {
input.push_str("S-"); input.push_str("S-");
} }
if state.contains(gdk::CONTROL_MASK) { if state.contains(gdk::ModifierType::CONTROL_MASK) {
input.push_str("C-"); input.push_str("C-");
} }
if state.contains(gdk::MOD1_MASK) { if state.contains(gdk::ModifierType::MOD1_MASK) {
input.push_str("A-"); input.push_str("A-");
} }
@ -79,7 +80,14 @@ pub fn convert_key(ev: &EventKey) -> Option<String> {
pub fn im_input(nvim: &mut Neovim, input: &str) { pub fn im_input(nvim: &mut Neovim, input: &str) {
debug!("nvim_input -> {}", input); debug!("nvim_input -> {}", input);
nvim.input(input).expect("Error run input command to nvim");
let input: String = input
.chars()
.map(|ch| {
keyval_to_input_string(&ch.to_string(), gdk::ModifierType::empty())
})
.collect();
nvim.input(&input).expect("Error run input command to nvim");
} }
pub fn gtk_key_press(nvim: &mut Neovim, ev: &EventKey) -> Inhibit { pub fn gtk_key_press(nvim: &mut Neovim, ev: &EventKey) -> Inhibit {

View File

@ -11,6 +11,7 @@ extern crate cairo;
extern crate pango; extern crate pango;
extern crate pango_sys; extern crate pango_sys;
extern crate pangocairo; extern crate pangocairo;
extern crate pango_cairo_sys;
extern crate neovim_lib; extern crate neovim_lib;
extern crate phf; extern crate phf;
#[macro_use] #[macro_use]
@ -52,65 +53,92 @@ mod error;
use std::env; use std::env;
use gio::{ApplicationExt, FileExt}; use std::time::Duration;
use std::str::FromStr;
use gio::prelude::*;
use ui::Ui; use ui::Ui;
use shell::ShellOptions; use shell::ShellOptions;
const BIN_PATH_ARG: &'static str = "--nvim-bin-path"; const BIN_PATH_ARG: &str = "--nvim-bin-path";
const TIMEOUT_ARG: &str = "--timeout";
fn main() { fn main() {
env_logger::init().expect("Can't initialize env_logger"); env_logger::init().expect("Can't initialize env_logger");
let app_flags = gio::APPLICATION_HANDLES_OPEN; let app_flags = gio::ApplicationFlags::HANDLES_OPEN | gio::ApplicationFlags::NON_UNIQUE;
let app = if cfg!(debug_assertions) { let app = if cfg!(debug_assertions) {
gtk::Application::new(Some("org.daa.NeovimGtkDebug"), gtk::Application::new(Some("org.daa.NeovimGtkDebug"), app_flags)
app_flags) } else {
} else { gtk::Application::new(Some("org.daa.NeovimGtk"), app_flags)
gtk::Application::new(Some("org.daa.NeovimGtk"), app_flags) }.expect("Failed to initialize GTK application");
}
.expect("Failed to initialize GTK application");
app.connect_activate(activate); app.connect_activate(activate);
{ app.connect_open(open);
use gio::ApplicationExtManual;
app.connect_open(open); let new_window_action = gio::SimpleAction::new("new-window", None);
} let app_ref = app.clone();
new_window_action.connect_activate(move |_, _| activate(&app_ref));
app.add_action(&new_window_action);
gtk::Window::set_default_icon_name("org.daa.NeovimGtk"); gtk::Window::set_default_icon_name("org.daa.NeovimGtk");
let args: Vec<String> = env::args().collect(); let args: Vec<String> = env::args().collect();
let argv: Vec<&str> = args.iter() let argv: Vec<String> = args.iter()
.filter(|a| !a.starts_with(BIN_PATH_ARG)) .filter(|a| !a.starts_with(BIN_PATH_ARG))
.map(String::as_str) .filter(|a| !a.starts_with(TIMEOUT_ARG))
.cloned()
.collect(); .collect();
app.run(&argv); app.run(&argv);
} }
fn open(app: &gtk::Application, files: &[gio::File], _: &str) { fn open(app: &gtk::Application, files: &[gio::File], _: &str) {
for f in files { for f in files {
let mut ui = Ui::new(ShellOptions::new(nvim_bin_path(std::env::args()), let mut ui = Ui::new(ShellOptions::new(
f.get_path().and_then(|p| p.to_str().map(str::to_owned)))); nvim_bin_path(std::env::args()),
f.get_path().and_then(|p| p.to_str().map(str::to_owned)),
nvim_timeout(std::env::args()),
));
ui.init(app); ui.init(app);
} }
} }
fn activate(app: &gtk::Application) { fn activate(app: &gtk::Application) {
let mut ui = Ui::new(ShellOptions::new(nvim_bin_path(std::env::args()), None)); let mut ui = Ui::new(ShellOptions::new(
nvim_bin_path(std::env::args()),
None,
nvim_timeout(std::env::args()),
));
ui.init(app); ui.init(app);
} }
fn nvim_bin_path<I>(args: I) -> Option<String> fn nvim_bin_path<I>(mut args: I) -> Option<String>
where I: Iterator<Item = String> where
I: Iterator<Item = String>,
{ {
args.skip_while(|a| !a.starts_with(BIN_PATH_ARG)) args.find(|a| a.starts_with(BIN_PATH_ARG)).and_then(|p| {
.map(|p| p.split('=').nth(1).map(str::to_owned)) p.split('=').nth(1).map(str::to_owned)
.nth(0) })
.unwrap_or(None) }
fn nvim_timeout<I>(mut args: I) -> Option<Duration>
where
I: Iterator<Item = String>,
{
args.find(|a| a.starts_with(TIMEOUT_ARG))
.and_then(|p| p.split('=').nth(1).map(str::to_owned))
.and_then(|timeout| match u64::from_str(&timeout) {
Ok(timeout) => Some(timeout),
Err(err) => {
error!("Can't convert timeout argument to integer: {}", err);
None
}
})
.map(|timeout| Duration::from_secs(timeout))
} }
#[cfg(test)] #[cfg(test)]
@ -119,9 +147,24 @@ mod tests {
#[test] #[test]
fn test_bin_path_arg() { fn test_bin_path_arg() {
assert_eq!(Some("/test_path".to_string()), assert_eq!(
nvim_bin_path(vec!["neovim-gtk", "--nvim-bin-path=/test_path"] Some("/test_path".to_string()),
.iter() nvim_bin_path(
.map(|s| s.to_string()))); vec!["neovim-gtk", "--nvim-bin-path=/test_path"]
.iter()
.map(|s| s.to_string()),
)
);
}
#[test]
fn test_timeout_arg() {
assert_eq!(
Some(Duration::from_secs(100)),
nvim_timeout(vec!["neovim-gtk", "--timeout=100"].iter().map(
|s| s.to_string(),
))
);
} }
} }

View File

@ -27,9 +27,7 @@ impl Mode {
} }
pub fn mode_info(&self) -> Option<&nvim::ModeInfo> { pub fn mode_info(&self) -> Option<&nvim::ModeInfo> {
self.info self.info.as_ref().and_then(|i| i.get(self.idx))
.as_ref()
.and_then(|i| i.get(self.idx))
} }
pub fn update(&mut self, mode: &str, idx: usize) { pub fn update(&mut self, mode: &str, idx: usize) {

View File

@ -2,7 +2,8 @@ use std::ops::{Deref, DerefMut};
use std::cell::{Cell, RefCell, RefMut}; use std::cell::{Cell, RefCell, RefMut};
use std::sync::{Arc, Mutex, MutexGuard}; use std::sync::{Arc, Mutex, MutexGuard};
use neovim_lib::Neovim; use super::ErrorReport;
use neovim_lib::{Neovim, NeovimApi};
#[derive(Clone, Copy, PartialEq)] #[derive(Clone, Copy, PartialEq)]
enum NeovimClientState { enum NeovimClientState {
@ -31,6 +32,17 @@ impl<'a> NeovimRef<'a> {
None None
} }
} }
pub fn non_blocked(mut self) -> Option<Self> {
self.get_mode().ok_and_report().and_then(|mode| {
mode.iter()
.find(|kv| {
kv.0.as_str().map(|key| key == "blocking").unwrap_or(false)
})
.map(|kv| kv.1.as_bool().unwrap_or(false))
.and_then(|block| if block { None } else { Some(self) })
})
}
} }
impl<'a> Deref for NeovimRef<'a> { impl<'a> Deref for NeovimRef<'a> {

23
src/nvim/ext.rs Normal file
View File

@ -0,0 +1,23 @@
use std::result;
use neovim_lib::CallError;
pub trait ErrorReport<T> {
fn report_err(&self);
fn ok_and_report(self) -> Option<T>;
}
impl<T> ErrorReport<T> for result::Result<T, CallError> {
fn report_err(&self) {
if let Err(ref err) = *self {
error!("{}", err);
}
}
fn ok_and_report(self) -> Option<T> {
self.report_err();
self.ok()
}
}

View File

@ -4,11 +4,13 @@ mod handler;
mod mode_info; mod mode_info;
mod redraw_handler; mod redraw_handler;
mod repaint_mode; mod repaint_mode;
mod ext;
pub use self::redraw_handler::{RedrawEvents, GuiApi}; pub use self::redraw_handler::{RedrawEvents, GuiApi, CompleteItem};
pub use self::repaint_mode::RepaintMode; pub use self::repaint_mode::RepaintMode;
pub use self::client::{NeovimClient, NeovimClientAsync, NeovimRef}; pub use self::client::{NeovimClient, NeovimClientAsync, NeovimRef};
pub use self::mode_info::{ModeInfo, CursorShape}; pub use self::mode_info::{ModeInfo, CursorShape};
pub use self::ext::ErrorReport;
use std::error; use std::error;
use std::fmt; use std::fmt;
@ -16,8 +18,9 @@ use std::env;
use std::process::{Stdio, Command}; use std::process::{Stdio, Command};
use std::result; use std::result;
use std::sync::Arc; use std::sync::Arc;
use std::time::Duration;
use neovim_lib::{Neovim, NeovimApi, Session, UiAttachOptions, CallError}; use neovim_lib::{Neovim, NeovimApi, Session, UiAttachOptions};
use ui::UiMutex; use ui::UiMutex;
use shell; use shell;
@ -78,6 +81,7 @@ impl error::Error for NvimInitError {
pub fn start( pub fn start(
shell: Arc<UiMutex<shell::State>>, shell: Arc<UiMutex<shell::State>>,
nvim_bin_path: Option<&String>, nvim_bin_path: Option<&String>,
timeout: Option<Duration>,
) -> result::Result<Neovim, NvimInitError> { ) -> result::Result<Neovim, NvimInitError> {
let mut cmd = if let Some(path) = nvim_bin_path { let mut cmd = if let Some(path) = nvim_bin_path {
Command::new(path) Command::new(path)
@ -116,11 +120,13 @@ pub fn start(
let session = Session::new_child_cmd(&mut cmd); let session = Session::new_child_cmd(&mut cmd);
let session = match session { let mut session = match session {
Err(e) => return Err(NvimInitError::new(&cmd, e)), Err(e) => return Err(NvimInitError::new(&cmd, e)),
Ok(s) => s, Ok(s) => s,
}; };
session.set_timeout(timeout.unwrap_or(Duration::from_millis(10_000)));
let mut nvim = Neovim::new(session); let mut nvim = Neovim::new(session);
nvim.session.start_event_loop_handler( nvim.session.start_event_loop_handler(
@ -163,23 +169,3 @@ pub fn post_start_init(
Ok(()) Ok(())
} }
pub trait ErrorReport<T> {
fn report_err(&self, nvim: &mut NeovimApi);
fn ok_and_report(self, nvim: &mut NeovimApi) -> Option<T>;
}
impl<T> ErrorReport<T> for result::Result<T, CallError> {
fn report_err(&self, _: &mut NeovimApi) {
if let Err(ref err) = *self {
println!("{}", err);
//nvim.report_error(&err_msg).expect("Error report error :)");
}
}
fn ok_and_report(self, nvim: &mut NeovimApi) -> Option<T> {
self.report_err(nvim);
self.ok()
}
}

View File

@ -45,7 +45,7 @@ pub trait RedrawEvents {
fn popupmenu_show( fn popupmenu_show(
&mut self, &mut self,
menu: Vec<Vec<String>>, menu: &[CompleteItem],
selected: i64, selected: i64,
row: u64, row: u64,
col: u64, col: u64,
@ -208,7 +208,20 @@ pub fn call(
"mouse_off" => ui.on_mouse(false), "mouse_off" => ui.on_mouse(false),
"busy_start" => ui.on_busy(true), "busy_start" => ui.on_busy(true),
"busy_stop" => ui.on_busy(false), "busy_stop" => ui.on_busy(false),
"popupmenu_show" => call!(ui->popupmenu_show(args: ext, int, uint, uint)), "popupmenu_show" => {
let menu_items = map_array!(args[0], "Error get menu list array", |item| {
map_array!(item, "Error get menu item array", |col| {
col.as_str().ok_or("Error get menu column")
})
})?;
ui.popupmenu_show(
&CompleteItem::map(&menu_items),
try_int!(args[1]),
try_uint!(args[2]),
try_uint!(args[3]),
)
}
"popupmenu_hide" => ui.popupmenu_hide(), "popupmenu_hide" => ui.popupmenu_hide(),
"popupmenu_select" => call!(ui->popupmenu_select(args: int)), "popupmenu_select" => call!(ui->popupmenu_select(args: int)),
"tabline_update" => { "tabline_update" => {
@ -251,3 +264,26 @@ pub fn call(
Ok(repaint_mode) Ok(repaint_mode)
} }
pub struct CompleteItem<'a> {
pub word: &'a str,
pub kind: &'a str,
pub menu: &'a str,
pub info: &'a str,
}
impl<'a> CompleteItem<'a> {
fn map(menu: &'a [Vec<&str>]) -> Vec<Self> {
menu.iter()
.map(|menu| {
CompleteItem {
word: menu[0],
kind: menu[1],
menu: menu[2],
info: menu[3],
}
})
.collect()
}
}

View File

@ -56,13 +56,13 @@ impl Manager {
} }
} }
PlugManageState::VimPlug => { PlugManageState::VimPlug => {
if Store::is_config_exists() { if Store::is_config_exists() {
self.store = Store::load(); self.store = Store::load();
self.plug_manage_state = PlugManageState::NvimGtk; self.plug_manage_state = PlugManageState::NvimGtk;
} else { } else {
self.store = Store::empty(); self.store = Store::empty();
} }
} }
} }
if let PlugManageState::Unknown = self.plug_manage_state { if let PlugManageState::Unknown = self.plug_manage_state {
if self.vim_plug.is_loaded() { if self.vim_plug.is_loaded() {
@ -106,7 +106,11 @@ impl PlugManagerConfigSource {
for plug in store.get_plugs() { for plug in store.get_plugs() {
if !plug.removed { if !plug.removed {
builder += &format!("Plug '{}', {{ 'as': '{}' }}\n", plug.get_plug_path(), plug.name); builder += &format!(
"Plug '{}', {{ 'as': '{}' }}\n",
plug.get_plug_path(),
plug.name
);
} }
} }

View File

@ -16,7 +16,7 @@ impl<'a> Builder<'a> {
let dlg = gtk::Dialog::new_with_buttons( let dlg = gtk::Dialog::new_with_buttons(
Some(self.title), Some(self.title),
Some(parent), Some(parent),
gtk::DIALOG_USE_HEADER_BAR | gtk::DIALOG_DESTROY_WITH_PARENT, gtk::DialogFlags::USE_HEADER_BAR | gtk::DialogFlags::DESTROY_WITH_PARENT,
&[ &[
("Cancel", gtk::ResponseType::Cancel.into()), ("Cancel", gtk::ResponseType::Cancel.into()),
("Ok", gtk::ResponseType::Ok.into()), ("Ok", gtk::ResponseType::Ok.into()),

View File

@ -68,7 +68,10 @@ impl Store {
pub fn add_plug(&mut self, plug: PlugInfo) -> bool { pub fn add_plug(&mut self, plug: PlugInfo) -> bool {
let path = plug.get_plug_path(); let path = plug.get_plug_path();
if self.settings.plugs.iter().any(|p| p.get_plug_path() == path || p.name == plug.name) { if self.settings.plugs.iter().any(|p| {
p.get_plug_path() == path || p.name == plug.name
})
{
return false; return false;
} }
self.settings.plugs.push(plug); self.settings.plugs.push(plug);
@ -81,7 +84,10 @@ impl Store {
pub fn move_item(&mut self, idx: usize, offset: i32) { pub fn move_item(&mut self, idx: usize, offset: i32) {
let plug = self.settings.plugs.remove(idx); let plug = self.settings.plugs.remove(idx);
self.settings.plugs.insert((idx as i32 + offset) as usize, plug); self.settings.plugs.insert(
(idx as i32 + offset) as usize,
plug,
);
} }
} }
@ -93,7 +99,10 @@ struct Settings {
impl Settings { impl Settings {
fn new(plugs: Vec<PlugInfo>) -> Self { fn new(plugs: Vec<PlugInfo>) -> Self {
Settings { plugs, enabled: false } Settings {
plugs,
enabled: false,
}
} }
} }
@ -101,7 +110,10 @@ impl SettingsLoader for Settings {
const SETTINGS_FILE: &'static str = "plugs.toml"; const SETTINGS_FILE: &'static str = "plugs.toml";
fn empty() -> Self { fn empty() -> Self {
Settings { plugs: vec![], enabled: false } Settings {
plugs: vec![],
enabled: false,
}
} }
fn from_str(s: &str) -> Result<Self, String> { fn from_str(s: &str) -> Result<Self, String> {

View File

@ -30,7 +30,7 @@ impl<'a> Ui<'a> {
let dlg = gtk::Dialog::new_with_buttons( let dlg = gtk::Dialog::new_with_buttons(
Some("Plug"), Some("Plug"),
Some(parent), Some(parent),
gtk::DIALOG_DESTROY_WITH_PARENT, gtk::DialogFlags::DESTROY_WITH_PARENT,
&[ &[
("Cancel", gtk::ResponseType::Cancel.into()), ("Cancel", gtk::ResponseType::Cancel.into()),
("Ok", gtk::ResponseType::Ok.into()), ("Ok", gtk::ResponseType::Ok.into()),
@ -43,7 +43,9 @@ impl<'a> Ui<'a> {
let header_bar = gtk::HeaderBar::new(); let header_bar = gtk::HeaderBar::new();
let add_plug_btn = gtk::Button::new_with_label("Add.."); let add_plug_btn = gtk::Button::new_with_label("Add..");
add_plug_btn.get_style_context().map(|c| c.add_class("suggested-action")); add_plug_btn.get_style_context().map(|c| {
c.add_class("suggested-action")
});
header_bar.pack_end(&add_plug_btn); header_bar.pack_end(&add_plug_btn);
@ -116,7 +118,9 @@ impl<'a> Ui<'a> {
let mut manager = self.manager.borrow_mut(); let mut manager = self.manager.borrow_mut();
manager.clear_removed(); manager.clear_removed();
manager.save(); manager.save();
if let Some(config_path) = NvimConfig::new(manager.generate_config()).generate_config() { if let Some(config_path) =
NvimConfig::new(manager.generate_config()).generate_config()
{
if let Some(path) = config_path.to_str() { if let Some(path) = config_path.to_str() {
manager.vim_plug.reload(path); manager.vim_plug.reload(path);
} }
@ -156,8 +160,10 @@ fn create_up_down_btns(
manager: &Arc<UiMutex<manager::Manager>>, manager: &Arc<UiMutex<manager::Manager>>,
) -> gtk::Box { ) -> gtk::Box {
let buttons_panel = gtk::Box::new(gtk::Orientation::Horizontal, 5); let buttons_panel = gtk::Box::new(gtk::Orientation::Horizontal, 5);
let up_btn = gtk::Button::new_from_icon_name("go-up-symbolic", gtk_sys::GTK_ICON_SIZE_BUTTON as i32); let up_btn =
let down_btn = gtk::Button::new_from_icon_name("go-down-symbolic", gtk_sys::GTK_ICON_SIZE_BUTTON as i32); gtk::Button::new_from_icon_name("go-up-symbolic", gtk_sys::GTK_ICON_SIZE_BUTTON as i32);
let down_btn =
gtk::Button::new_from_icon_name("go-down-symbolic", gtk_sys::GTK_ICON_SIZE_BUTTON as i32);
up_btn.connect_clicked(clone!(plugs_panel, manager => move |_| { up_btn.connect_clicked(clone!(plugs_panel, manager => move |_| {
if let Some(row) = plugs_panel.get_selected_row() { if let Some(row) = plugs_panel.get_selected_row() {

View File

@ -70,7 +70,7 @@ impl Manager {
if let Some(mut nvim) = self.nvim() { if let Some(mut nvim) = self.nvim() {
let loaded_plug = nvim.eval("exists('g:loaded_plug')"); let loaded_plug = nvim.eval("exists('g:loaded_plug')");
loaded_plug loaded_plug
.ok_and_report(&mut *nvim) .ok_and_report()
.and_then(|loaded_plug| loaded_plug.as_i64()) .and_then(|loaded_plug| loaded_plug.as_i64())
.map_or(false, |loaded_plug| if loaded_plug > 0 { .map_or(false, |loaded_plug| if loaded_plug > 0 {
true true
@ -84,7 +84,7 @@ impl Manager {
pub fn reload(&self, path: &str) { pub fn reload(&self, path: &str) {
if let Some(mut nvim) = self.nvim() { if let Some(mut nvim) = self.nvim() {
nvim.command(&format!("source {}", path)).report_err(&mut *nvim); nvim.command(&format!("source {}", path)).report_err();
} }
} }
} }
@ -100,4 +100,3 @@ impl VimPlugInfo {
VimPlugInfo { name, uri } VimPlugInfo { name, uri }
} }
} }

View File

@ -42,9 +42,10 @@ fn request(query: Option<&str>) -> io::Result<DescriptionList> {
if out.stdout.is_empty() { if out.stdout.is_empty() {
Ok(DescriptionList::empty()) Ok(DescriptionList::empty())
} else { } else {
let description_list: DescriptionList = serde_json::from_slice(&out.stdout).map_err(|e| { let description_list: DescriptionList =
io::Error::new(io::ErrorKind::Other, e) serde_json::from_slice(&out.stdout).map_err(|e| {
})?; io::Error::new(io::ErrorKind::Other, e)
})?;
Ok(description_list) Ok(description_list)
} }
} else { } else {
@ -147,9 +148,7 @@ pub struct DescriptionList {
impl DescriptionList { impl DescriptionList {
fn empty() -> DescriptionList { fn empty() -> DescriptionList {
DescriptionList { DescriptionList { plugins: Box::new([]) }
plugins: Box::new([]),
}
} }
} }

View File

@ -22,6 +22,7 @@ struct State {
tree: gtk::TreeView, tree: gtk::TreeView,
scroll: gtk::ScrolledWindow, scroll: gtk::ScrolledWindow,
css_provider: gtk::CssProvider, css_provider: gtk::CssProvider,
info_label: gtk::Label,
} }
impl State { impl State {
@ -32,12 +33,36 @@ impl State {
let style_context = tree.get_style_context().unwrap(); let style_context = tree.get_style_context().unwrap();
style_context.add_provider(&css_provider, gtk::STYLE_PROVIDER_PRIORITY_APPLICATION); style_context.add_provider(&css_provider, gtk::STYLE_PROVIDER_PRIORITY_APPLICATION);
let renderer = gtk::CellRendererText::new();
// word
let column = gtk::TreeViewColumn::new();
column.pack_start(&renderer, true);
column.add_attribute(&renderer, "text", 0);
tree.append_column(&column);
// kind
let column = gtk::TreeViewColumn::new();
column.pack_start(&renderer, true);
column.add_attribute(&renderer, "text", 1);
tree.append_column(&column);
// menu
let column = gtk::TreeViewColumn::new();
column.pack_start(&renderer, true);
column.add_attribute(&renderer, "text", 2);
tree.append_column(&column);
let info_label = gtk::Label::new(None);
info_label.set_line_wrap(true);
State { State {
nvim: None, nvim: None,
renderer: gtk::CellRendererText::new(),
tree, tree,
scroll: gtk::ScrolledWindow::new(None, None), scroll: gtk::ScrolledWindow::new(None, None),
renderer,
css_provider, css_provider,
info_label,
} }
} }
@ -46,6 +71,8 @@ impl State {
self.nvim = Some(ctx.nvim.clone()); self.nvim = Some(ctx.nvim.clone());
} }
self.scroll.set_max_content_width(ctx.max_width);
self.scroll.set_propagate_natural_width(true);
self.update_tree(&ctx); self.update_tree(&ctx);
self.select(ctx.selected); self.select(ctx.selected);
} }
@ -69,25 +96,11 @@ impl State {
self.update_css(color_model); self.update_css(color_model);
let col_count = ctx.menu_items[0].len(); let list_store = gtk::ListStore::new(&vec![gtk::Type::String; 4]);
let columns = self.tree.get_columns(); let all_column_ids: Vec<u32> = (0..4).map(|i| i as u32).collect();
if columns.len() != col_count {
for col in columns {
self.tree.remove_column(&col);
}
for i in 0..col_count {
self.append_column(i as i32);
}
}
let list_store = gtk::ListStore::new(&vec![gtk::Type::String; col_count]);
let all_column_ids: Vec<u32> = (0..col_count).map(|i| i as u32).collect();
for line in ctx.menu_items { for line in ctx.menu_items {
let line_array: Vec<&glib::ToValue> = let line_array: [&glib::ToValue; 4] = [&line.word, &line.kind, &line.menu, &line.info];
line.iter().map(|v| v as &glib::ToValue).collect();
list_store.insert_with_values(None, &all_column_ids, &line_array[..]); list_store.insert_with_values(None, &all_column_ids, &line_array[..]);
} }
@ -98,28 +111,19 @@ impl State {
let bg = color_model.pmenu_bg_sel(); let bg = color_model.pmenu_bg_sel();
let fg = color_model.pmenu_fg_sel(); let fg = color_model.pmenu_fg_sel();
match gtk::CssProviderExtManual::load_from_data( match gtk::CssProviderExt::load_from_data(
&self.css_provider, &self.css_provider,
&format!( &format!(
".view {{ color: {}; background-color: {};}}", ".view {{ color: {}; background-color: {};}}",
fg.to_hex(), fg.to_hex(),
bg.to_hex() bg.to_hex()
), ).as_bytes(),
) { ) {
Err(e) => error!("Can't update css {}", e), Err(e) => error!("Can't update css {}", e),
Ok(_) => (), Ok(_) => (),
}; };
} }
fn append_column(&self, id: i32) {
let renderer = &self.renderer;
let column = gtk::TreeViewColumn::new();
column.pack_start(renderer, true);
column.add_attribute(renderer, "text", id);
self.tree.append_column(&column);
}
fn select(&self, selected: i64) { fn select(&self, selected: i64) {
if selected >= 0 { if selected >= 0 {
let selected_path = gtk::TreePath::new_from_string(&format!("{}", selected)); let selected_path = gtk::TreePath::new_from_string(&format!("{}", selected));
@ -131,8 +135,31 @@ impl State {
0.0, 0.0,
0.0, 0.0,
); );
self.show_info_column(&selected_path);
} else { } else {
self.tree.get_selection().unselect_all(); self.tree.get_selection().unselect_all();
self.info_label.hide();
}
}
fn show_info_column(&self, selected_path: &gtk::TreePath) {
let model = self.tree.get_model().unwrap();
let iter = model.get_iter(selected_path);
if let Some(iter) = iter {
let info_value = model.get_value(&iter, 3);
let info: &str = info_value.get().unwrap();
if !info.trim().is_empty() {
self.info_label.show();
self.info_label.set_text(&info);
} else {
self.info_label.hide();
}
} else {
self.info_label.hide();
} }
} }
@ -161,18 +188,24 @@ impl PopupMenu {
let popover = gtk::Popover::new(Some(drawing)); let popover = gtk::Popover::new(Some(drawing));
popover.set_modal(false); popover.set_modal(false);
let content = gtk::Box::new(gtk::Orientation::Vertical, 0);
state.tree.set_headers_visible(false); state.tree.set_headers_visible(false);
state.tree.set_can_focus(false); state.tree.set_can_focus(false);
state.scroll.set_policy( state.scroll.set_policy(
gtk::PolicyType::Never, gtk::PolicyType::Automatic,
gtk::PolicyType::Automatic, gtk::PolicyType::Automatic,
); );
state.scroll.add(&state.tree); state.scroll.add(&state.tree);
state.scroll.show_all(); state.scroll.show_all();
popover.add(&state.scroll);
content.pack_start(&state.scroll, true, true, 0);
content.pack_start(&state.info_label, false, true, 0);
content.show();
popover.add(&content);
let state = Rc::new(RefCell::new(state)); let state = Rc::new(RefCell::new(state));
let state_ref = state.clone(); let state_ref = state.clone();
@ -216,7 +249,6 @@ impl PopupMenu {
} }
pub fn show(&mut self, ctx: PopupMenuContext) { pub fn show(&mut self, ctx: PopupMenuContext) {
self.open = true; self.open = true;
self.popover.set_pointing_to(&gtk::Rectangle { self.popover.set_pointing_to(&gtk::Rectangle {
@ -246,12 +278,13 @@ pub struct PopupMenuContext<'a> {
pub nvim: &'a Rc<NeovimClient>, pub nvim: &'a Rc<NeovimClient>,
pub color_model: &'a ColorModel, pub color_model: &'a ColorModel,
pub font_ctx: &'a render::Context, pub font_ctx: &'a render::Context,
pub menu_items: &'a [Vec<String>], pub menu_items: &'a [nvim::CompleteItem<'a>],
pub selected: i64, pub selected: i64,
pub x: i32, pub x: i32,
pub y: i32, pub y: i32,
pub width: i32, pub width: i32,
pub height: i32, pub height: i32,
pub max_width: i32,
} }
fn tree_button_press(tree: &gtk::TreeView, ev: &EventButton, nvim: &mut Neovim) -> Inhibit { fn tree_button_press(tree: &gtk::TreeView, ev: &EventButton, nvim: &mut Neovim) -> Inhibit {
@ -284,7 +317,7 @@ fn tree_button_press(tree: &gtk::TreeView, ev: &EventButton, nvim: &mut Neovim)
} }
apply_command.push_str("<C-y>"); apply_command.push_str("<C-y>");
nvim.input(&apply_command).report_err(nvim); nvim.input(&apply_command).report_err();
} }
Inhibit(false) Inhibit(false)

View File

@ -30,18 +30,22 @@ enum ProjectViewColumns {
} }
const COLUMN_COUNT: usize = 6; const COLUMN_COUNT: usize = 6;
const COLUMN_TYPES: [Type; COLUMN_COUNT] = [Type::String, const COLUMN_TYPES: [Type; COLUMN_COUNT] = [
Type::String, Type::String,
Type::String, Type::String,
Type::String, Type::String,
Type::Bool, Type::String,
Type::Bool]; Type::Bool,
const COLUMN_IDS: [u32; COLUMN_COUNT] = [ProjectViewColumns::Name as u32, Type::Bool,
ProjectViewColumns::Path as u32, ];
ProjectViewColumns::Uri as u32, const COLUMN_IDS: [u32; COLUMN_COUNT] = [
ProjectViewColumns::Pixbuf as u32, ProjectViewColumns::Name as u32,
ProjectViewColumns::Project as u32, ProjectViewColumns::Path as u32,
ProjectViewColumns::ProjectStored as u32]; ProjectViewColumns::Uri as u32,
ProjectViewColumns::Pixbuf as u32,
ProjectViewColumns::Project as u32,
ProjectViewColumns::ProjectStored as u32,
];
pub struct Projects { pub struct Projects {
shell: Rc<RefCell<Shell>>, shell: Rc<RefCell<Shell>>,
@ -79,9 +83,10 @@ impl Projects {
vbox.pack_start(&search_box, false, true, 0); vbox.pack_start(&search_box, false, true, 0);
projects projects.scroll.set_policy(
.scroll PolicyType::Never,
.set_policy(PolicyType::Never, PolicyType::Automatic); PolicyType::Automatic,
);
projects.scroll.add(&projects.tree); projects.scroll.add(&projects.tree);
@ -97,10 +102,9 @@ impl Projects {
let projects = Rc::new(RefCell::new(projects)); let projects = Rc::new(RefCell::new(projects));
let prj_ref = projects.clone(); let prj_ref = projects.clone();
projects projects.borrow().tree.connect_size_allocate(move |_, _| {
.borrow() on_treeview_allocate(prj_ref.clone())
.tree });
.connect_size_allocate(move |_, _| on_treeview_allocate(prj_ref.clone()));
let prj_ref = projects.clone(); let prj_ref = projects.clone();
search_box.connect_changed(move |search_box| { search_box.connect_changed(move |search_box| {
@ -115,45 +119,44 @@ impl Projects {
let prj_ref = projects.clone(); let prj_ref = projects.clone();
search_box.connect_activate(move |_| { search_box.connect_activate(move |_| {
let model = prj_ref.borrow().tree.get_model().unwrap(); let model = prj_ref.borrow().tree.get_model().unwrap();
if let Some(iter) = model.get_iter_first() { if let Some(iter) = model.get_iter_first() {
prj_ref.borrow().open_uri(&model, &iter); prj_ref.borrow().open_uri(&model, &iter);
let popup = prj_ref.borrow().popup.clone(); let popup = prj_ref.borrow().popup.clone();
popup.popdown(); popup.popdown();
} }
}); });
let prj_ref = projects.clone(); let prj_ref = projects.clone();
projects projects.borrow().tree.connect_row_activated(
.borrow() move |tree, _, _| {
.tree let selection = tree.get_selection();
.connect_row_activated(move |tree, _, _| { if let Some((model, iter)) = selection.get_selected() {
let selection = tree.get_selection(); prj_ref.borrow().open_uri(&model, &iter);
if let Some((model, iter)) = selection.get_selected() { let popup = prj_ref.borrow().popup.clone();
prj_ref.borrow().open_uri(&model, &iter); popup.popdown();
let popup = prj_ref.borrow().popup.clone(); }
popup.popdown(); },
} );
});
let prj_ref = projects.clone(); let prj_ref = projects.clone();
open_btn.connect_clicked(move |_| { open_btn.connect_clicked(move |_| {
prj_ref.borrow().show_open_file_dlg(); prj_ref.borrow().show_open_file_dlg();
let popup = prj_ref.borrow().popup.clone(); let popup = prj_ref.borrow().popup.clone();
popup.popdown(); popup.popdown();
}); });
let prj_ref = projects.clone(); let prj_ref = projects.clone();
projects projects.borrow().popup.connect_closed(
.borrow() move |_| prj_ref.borrow_mut().clear(),
.popup );
.connect_closed(move |_| prj_ref.borrow_mut().clear());
let prj_ref = projects.clone(); let prj_ref = projects.clone();
projects projects.borrow().toggle_renderer.connect_toggled(
.borrow() move |_, path| {
.toggle_renderer prj_ref.borrow_mut().toggle_stored(&path)
.connect_toggled(move |_, path| prj_ref.borrow_mut().toggle_stored(&path)); },
);
projects projects
} }
@ -165,9 +168,11 @@ impl Projects {
.get() .get()
.unwrap(); .unwrap();
list_store.set_value(&iter, list_store.set_value(
ProjectViewColumns::ProjectStored as u32, &iter,
&ToValue::to_value(&!value)); ProjectViewColumns::ProjectStored as u32,
&ToValue::to_value(&!value),
);
let pixbuf = if value { let pixbuf = if value {
CURRENT_DIR_PIXBUF CURRENT_DIR_PIXBUF
@ -175,9 +180,11 @@ impl Projects {
BOOKMARKED_PIXBUF BOOKMARKED_PIXBUF
}; };
list_store.set_value(&iter, list_store.set_value(
ProjectViewColumns::Pixbuf as u32, &iter,
&ToValue::to_value(pixbuf)); ProjectViewColumns::Pixbuf as u32,
&ToValue::to_value(pixbuf),
);
let uri_value = list_store.get_value(&iter, ProjectViewColumns::Uri as i32); let uri_value = list_store.get_value(&iter, ProjectViewColumns::Uri as i32);
let uri: String = uri_value.get().unwrap(); let uri: String = uri_value.get().unwrap();
@ -194,8 +201,14 @@ impl Projects {
fn open_uri(&self, model: &TreeModel, iter: &TreeIter) { fn open_uri(&self, model: &TreeModel, iter: &TreeIter) {
let uri: String = model.get_value(iter, ProjectViewColumns::Uri as i32).get().unwrap(); let uri: String = model
let project: bool = model.get_value(iter, ProjectViewColumns::Project as i32).get().unwrap(); .get_value(iter, ProjectViewColumns::Uri as i32)
.get()
.unwrap();
let project: bool = model
.get_value(iter, ProjectViewColumns::Project as i32)
.get()
.unwrap();
let shell = self.shell.borrow(); let shell = self.shell.borrow();
if project { if project {
@ -218,9 +231,11 @@ impl Projects {
.unwrap() .unwrap()
.downcast::<gtk::Window>() .downcast::<gtk::Window>()
.ok(); .ok();
let dlg = gtk::FileChooserDialog::new(Some("Open Document"), let dlg = gtk::FileChooserDialog::new(
window.as_ref(), Some("Open Document"),
gtk::FileChooserAction::Open); window.as_ref(),
gtk::FileChooserAction::Open,
);
const OPEN_ID: i32 = 0; const OPEN_ID: i32 = 0;
const CANCEL_ID: i32 = 1; const CANCEL_ID: i32 = 1;
@ -268,9 +283,11 @@ impl Projects {
let icon_renderer = CellRendererPixbuf::new(); let icon_renderer = CellRendererPixbuf::new();
image_column.pack_start(&icon_renderer, true); image_column.pack_start(&icon_renderer, true);
image_column.add_attribute(&icon_renderer, image_column.add_attribute(
"icon-name", &icon_renderer,
ProjectViewColumns::Pixbuf as i32); "icon-name",
ProjectViewColumns::Pixbuf as i32,
);
self.tree.append_column(&image_column); self.tree.append_column(&image_column);
@ -278,18 +295,23 @@ impl Projects {
self.name_renderer.set_property_width_chars(60); self.name_renderer.set_property_width_chars(60);
self.path_renderer.set_property_width_chars(60); self.path_renderer.set_property_width_chars(60);
self.path_renderer self.path_renderer.set_property_ellipsize(
.set_property_ellipsize(pango::EllipsizeMode::Start); pango::EllipsizeMode::Start,
);
text_column.pack_start(&self.name_renderer, true); text_column.pack_start(&self.name_renderer, true);
text_column.pack_start(&self.path_renderer, true); text_column.pack_start(&self.path_renderer, true);
text_column.add_attribute(&self.name_renderer, text_column.add_attribute(
"markup", &self.name_renderer,
ProjectViewColumns::Name as i32); "markup",
text_column.add_attribute(&self.path_renderer, ProjectViewColumns::Name as i32,
"markup", );
ProjectViewColumns::Path as i32); text_column.add_attribute(
&self.path_renderer,
"markup",
ProjectViewColumns::Path as i32,
);
let area = text_column let area = text_column
.get_area() .get_area()
@ -306,12 +328,16 @@ impl Projects {
self.toggle_renderer.set_padding(10, 0); self.toggle_renderer.set_padding(10, 0);
toggle_column.pack_start(&self.toggle_renderer, true); toggle_column.pack_start(&self.toggle_renderer, true);
toggle_column.add_attribute(&self.toggle_renderer, toggle_column.add_attribute(
"visible", &self.toggle_renderer,
ProjectViewColumns::Project as i32); "visible",
toggle_column.add_attribute(&self.toggle_renderer, ProjectViewColumns::Project as i32,
"active", );
ProjectViewColumns::ProjectStored as i32); toggle_column.add_attribute(
&self.toggle_renderer,
"active",
ProjectViewColumns::ProjectStored as i32,
);
self.tree.append_column(&toggle_column); self.tree.append_column(&toggle_column);
} }
@ -333,19 +359,19 @@ fn on_treeview_allocate(projects: Rc<RefCell<Projects>>) {
let treeview_height = projects.borrow().calc_treeview_height(); let treeview_height = projects.borrow().calc_treeview_height();
idle_add(move || { idle_add(move || {
let prj = projects.borrow(); let prj = projects.borrow();
// strange solution to make gtk assertions happy // strange solution to make gtk assertions happy
let previous_height = prj.scroll.get_max_content_height(); let previous_height = prj.scroll.get_max_content_height();
if previous_height < treeview_height { if previous_height < treeview_height {
prj.scroll.set_max_content_height(treeview_height); prj.scroll.set_max_content_height(treeview_height);
prj.scroll.set_min_content_height(treeview_height); prj.scroll.set_min_content_height(treeview_height);
} else if previous_height > treeview_height { } else if previous_height > treeview_height {
prj.scroll.set_min_content_height(treeview_height); prj.scroll.set_min_content_height(treeview_height);
prj.scroll.set_max_content_height(treeview_height); prj.scroll.set_max_content_height(treeview_height);
} }
Continue(false) Continue(false)
}); });
} }
@ -368,7 +394,7 @@ fn list_old_files(nvim: &mut Neovim) -> Vec<String> {
} }
} }
err @ Err(_) => { err @ Err(_) => {
err.report_err(nvim); err.report_err();
vec![] vec![]
} }
} }
@ -381,9 +407,7 @@ pub struct EntryStore {
impl EntryStore { impl EntryStore {
pub fn find_mut(&mut self, uri: &str) -> Option<&mut Entry> { pub fn find_mut(&mut self, uri: &str) -> Option<&mut Entry> {
self.entries self.entries.iter_mut().find(|e| e.project && e.uri == uri)
.iter_mut()
.find(|e| e.project && e.uri == uri)
} }
pub fn load(nvim: &mut Neovim) -> EntryStore { pub fn load(nvim: &mut Neovim) -> EntryStore {
@ -396,17 +420,14 @@ impl EntryStore {
match nvim.call_function("getcwd", vec![]) { match nvim.call_function("getcwd", vec![]) {
Ok(pwd) => { Ok(pwd) => {
if let Some(pwd) = pwd.as_str() { if let Some(pwd) = pwd.as_str() {
if entries if entries.iter().find(|e| e.project && e.uri == pwd).is_none() {
.iter()
.find(|e| e.project && e.uri == pwd)
.is_none() {
entries.insert(0, Entry::new_current_project(pwd)); entries.insert(0, Entry::new_current_project(pwd));
} }
} else { } else {
println!("Error get current directory"); println!("Error get current directory");
} }
} }
err @ Err(_) => err.report_err(nvim), err @ Err(_) => err.report_err(),
} }
let old_files = list_old_files(nvim); let old_files = list_old_files(nvim);
@ -420,24 +441,26 @@ impl EntryStore {
pub fn save(&self) { pub fn save(&self) {
if self.changed { if self.changed {
ProjectSettings::new(self.entries ProjectSettings::new(
.iter() self.entries
.filter(|e| e.project && e.stored) .iter()
.map(|p| p.to_entry_settings()) .filter(|e| e.project && e.stored)
.collect()) .map(|p| p.to_entry_settings())
.save(); .collect(),
).save();
} }
} }
pub fn populate(&self, list_store: &ListStore, filter: Option<&String>) { pub fn populate(&self, list_store: &ListStore, filter: Option<&String>) {
for file in &self.entries { for file in &self.entries {
if match filter.map(|f| f.to_uppercase()) { if match filter.map(|f| f.to_uppercase()) {
Some(ref filter) => { Some(ref filter) => {
file.file_name.to_uppercase().contains(filter) || file.file_name.to_uppercase().contains(filter) ||
file.path.to_uppercase().contains(filter) file.path.to_uppercase().contains(filter)
} }
None => true, None => true,
} { }
{
list_store.insert_with_values(None, &COLUMN_IDS, &file.to_values()); list_store.insert_with_values(None, &COLUMN_IDS, &file.to_values());
} }
} }
@ -465,7 +488,9 @@ impl Entry {
Entry { Entry {
uri: uri.to_owned(), uri: uri.to_owned(),
path: path.parent() path: path.parent()
.map(|s| format!("<small>{}</small>", encode_minimal(&s.to_string_lossy()))) .map(|s| {
format!("<small>{}</small>", encode_minimal(&s.to_string_lossy()))
})
.unwrap_or_else(|| "".to_owned()), .unwrap_or_else(|| "".to_owned()),
file_name: format!("<big>{}</big>", encode_minimal(name)), file_name: format!("<big>{}</big>", encode_minimal(name)),
name: name.to_owned(), name: name.to_owned(),
@ -484,7 +509,9 @@ impl Entry {
Entry { Entry {
uri: uri.to_owned(), uri: uri.to_owned(),
path: path.parent() path: path.parent()
.map(|s| format!("<small>{}</small>", encode_minimal(&s.to_string_lossy()))) .map(|s| {
format!("<small>{}</small>", encode_minimal(&s.to_string_lossy()))
})
.unwrap_or_else(|| "".to_owned()), .unwrap_or_else(|| "".to_owned()),
file_name: format!("<big>{}</big>", encode_minimal(&name)), file_name: format!("<big>{}</big>", encode_minimal(&name)),
name, name,
@ -504,9 +531,8 @@ impl Entry {
uri: uri.to_owned(), uri: uri.to_owned(),
path: path.parent() path: path.parent()
.map(|s| { .map(|s| {
format!("<small>{}</small>", format!("<small>{}</small>", encode_minimal(&s.to_string_lossy()))
encode_minimal(&s.to_string_lossy())) })
})
.unwrap_or_else(|| "".to_owned()), .unwrap_or_else(|| "".to_owned()),
file_name: format!("<big>{}</big>", encode_minimal(&name)), file_name: format!("<big>{}</big>", encode_minimal(&name)),
name, name,
@ -517,12 +543,16 @@ impl Entry {
} }
fn to_values(&self) -> Box<[&gtk::ToValue]> { fn to_values(&self) -> Box<[&gtk::ToValue]> {
Box::new([&self.file_name, Box::new(
&self.path, [
&self.uri, &self.file_name,
&self.pixbuf, &self.path,
&self.project, &self.uri,
&self.stored]) &self.pixbuf,
&self.project,
&self.stored,
],
)
} }
fn to_entry_settings(&self) -> ProjectEntrySettings { fn to_entry_settings(&self) -> ProjectEntrySettings {
@ -576,4 +606,3 @@ impl ProjectSettings {
ProjectSettings { projects } ProjectSettings { projects }
} }
} }

View File

@ -57,7 +57,7 @@ struct ContextState {
impl ContextState { impl ContextState {
pub fn new(font_desc: pango::FontDescription) -> Self { pub fn new(font_desc: pango::FontDescription) -> Self {
let font_map = FontMap::get_default(); let font_map = FontMap::get_default().unwrap();
let pango_context = font_map.create_context().unwrap(); let pango_context = font_map.create_context().unwrap();
pango_context.set_font_description(&font_desc); pango_context.set_font_description(&font_desc);

View File

@ -9,10 +9,12 @@ use self::model_clip_iterator::{RowView, ModelClipIteratorFactory};
use mode; use mode;
use color; use color;
use sys::pango::*; use sys::pango::*;
use sys::pangocairo::*;
use pango; use pango;
use cairo; use cairo;
use pangocairo;
use cursor; use cursor;
use pangocairo::CairoContextExt;
use ui_model; use ui_model;
pub fn render<RC: cursor::CursorRedrawCb + 'static>( pub fn render<RC: cursor::CursorRedrawCb + 'static>(
@ -34,6 +36,15 @@ pub fn render<RC: cursor::CursorRedrawCb + 'static>(
let &CellMetrics { char_width, .. } = cell_metrics; let &CellMetrics { char_width, .. } = cell_metrics;
let (cursor_row, cursor_col) = ui_model.get_cursor(); let (cursor_row, cursor_col) = ui_model.get_cursor();
for cell_view in ui_model.get_clip_iterator(ctx, cell_metrics) {
let mut line_x = 0.0;
for (col, cell) in cell_view.line.line.iter().enumerate() {
draw_cell_bg(&cell_view, color_model, cell, col, line_x);
line_x += char_width;
}
}
for cell_view in ui_model.get_clip_iterator(ctx, cell_metrics) { for cell_view in ui_model.get_clip_iterator(ctx, cell_metrics) {
let mut line_x = 0.0; let mut line_x = 0.0;
let RowView { line, row, line_y, .. } = cell_view; let RowView { line, row, line_y, .. } = cell_view;
@ -44,7 +55,6 @@ pub fn render<RC: cursor::CursorRedrawCb + 'static>(
draw_underline(&cell_view, color_model, cell, line_x); draw_underline(&cell_view, color_model, cell, line_x);
if row == cursor_row && col == cursor_col { if row == cursor_row && col == cursor_col {
let double_width = line.line.get(col + 1).map_or( let double_width = line.line.get(col + 1).map_or(
false, false,
@ -96,7 +106,7 @@ fn draw_underline(
let undercurl_height = (underline_thickness * 4.0).min(max_undercurl_height); let undercurl_height = (underline_thickness * 4.0).min(max_undercurl_height);
let undercurl_y = line_y + underline_position - undercurl_height / 2.0; let undercurl_y = line_y + underline_position - undercurl_height / 2.0;
ctx.show_error_underline(line_x, undercurl_y, char_width, undercurl_height); pangocairo::functions::error_underline_path(ctx, line_x, undercurl_y, char_width, undercurl_height);
} else if cell.attrs.underline { } else if cell.attrs.underline {
let fg = color_model.actual_cell_fg(cell); let fg = color_model.actual_cell_fg(cell);
ctx.set_source_rgb(fg.0, fg.1, fg.2); ctx.set_source_rgb(fg.0, fg.1, fg.2);
@ -108,6 +118,48 @@ fn draw_underline(
} }
} }
fn draw_cell_bg(
cell_view: &RowView,
color_model: &color::ColorModel,
cell: &ui_model::Cell,
col: usize,
line_x: f64,
) {
let &RowView {
ctx,
line,
line_y,
cell_metrics: &CellMetrics {
char_width,
line_height,
..
},
..
} = cell_view;
let bg = color_model.cell_bg(cell);
if let Some(bg) = bg {
if !line.is_binded_to_item(col) {
if bg != &color_model.bg_color {
ctx.set_source_rgb(bg.0, bg.1, bg.2);
ctx.rectangle(line_x, line_y, char_width, line_height);
ctx.fill();
}
} else {
ctx.set_source_rgb(bg.0, bg.1, bg.2);
ctx.rectangle(
line_x,
line_y,
char_width * line.item_len_from_idx(col) as f64,
line_height,
);
ctx.fill();
}
}
}
fn draw_cell( fn draw_cell(
cell_view: &RowView, cell_view: &RowView,
color_model: &color::ColorModel, color_model: &color::ColorModel,
@ -121,41 +173,22 @@ fn draw_cell(
line, line,
line_y, line_y,
cell_metrics: &CellMetrics { cell_metrics: &CellMetrics {
char_width,
line_height,
ascent, ascent,
.. ..
}, },
.. ..
} = cell_view; } = cell_view;
let (bg, fg) = color_model.cell_colors(cell);
if let Some(item) = line.item_line[col].as_ref() { if let Some(item) = line.item_line[col].as_ref() {
if let Some(bg) = bg {
ctx.set_source_rgb(bg.0, bg.1, bg.2);
ctx.rectangle(
line_x,
line_y,
char_width * line.item_len_from_idx(col) as f64,
line_height,
);
ctx.fill();
}
if let Some(ref glyphs) = item.glyphs { if let Some(ref glyphs) = item.glyphs {
let fg = color_model.actual_cell_fg(cell);
ctx.move_to(line_x, line_y + ascent); ctx.move_to(line_x, line_y + ascent);
ctx.set_source_rgb(fg.0, fg.1, fg.2); ctx.set_source_rgb(fg.0, fg.1, fg.2);
ctx.show_glyph_string(item.font(), glyphs);
show_glyph_string(ctx, item.font(), glyphs);
} }
} else if !line.is_binded_to_item(col) {
let bg = color_model.cell_bg(cell);
if let Some(bg) = bg {
ctx.set_source_rgb(bg.0, bg.1, bg.2);
ctx.rectangle(line_x, line_y, char_width, line_height);
ctx.fill();
}
} }
} }

View File

@ -1,12 +1,12 @@
use std::cell::{RefCell, Cell}; use std::cell::RefCell;
use std::rc::Rc; use std::rc::Rc;
use std::sync::{Arc, Condvar, Mutex}; use std::sync::{Arc, Condvar, Mutex};
use std::ops::Deref; use std::ops::Deref;
use std::thread; use std::thread;
use std::collections::HashMap; use std::collections::HashMap;
use std::time::Duration;
use cairo; use cairo;
use pangocairo::CairoContextExt;
use pango::{LayoutExt, FontDescription}; use pango::{LayoutExt, FontDescription};
use gdk; use gdk;
use gdk::{ModifierType, EventButton, EventMotion, EventType, EventScroll}; use gdk::{ModifierType, EventButton, EventMotion, EventType, EventScroll};
@ -14,6 +14,7 @@ use gdk_sys;
use glib; use glib;
use gtk; use gtk;
use gtk::prelude::*; use gtk::prelude::*;
use pangocairo;
use neovim_lib::{Neovim, NeovimApi, Value}; use neovim_lib::{Neovim, NeovimApi, Value};
use neovim_lib::neovim_api::Tabpage; use neovim_lib::neovim_api::Tabpage;
@ -21,16 +22,15 @@ use neovim_lib::neovim_api::Tabpage;
use settings::{Settings, FontSource}; use settings::{Settings, FontSource};
use ui_model::{UiModel, Attrs, ModelRect}; use ui_model::{UiModel, Attrs, ModelRect};
use color::{ColorModel, Color, COLOR_BLACK, COLOR_WHITE, COLOR_RED}; use color::{ColorModel, Color, COLOR_BLACK, COLOR_WHITE, COLOR_RED};
use nvim::{self, RedrawEvents, GuiApi, RepaintMode, ErrorReport, NeovimClient,
use nvim::{self, RedrawEvents, GuiApi, RepaintMode, ErrorReport, NeovimClient, NeovimRef, NeovimRef, NeovimClientAsync, CompleteItem};
NeovimClientAsync}; use input;
use input::keyval_to_input_string;
use input::{self, keyval_to_input_string};
use cursor::{Cursor, CursorRedrawCb}; use cursor::{Cursor, CursorRedrawCb};
use ui::UiMutex; use ui::UiMutex;
use popup_menu::{self, PopupMenu}; use popup_menu::{self, PopupMenu};
use tabline::Tabline; use tabline::Tabline;
use cmd_line::{self, CmdLine}; use cmd_line::CmdLine;
use error; use error;
use mode; use mode;
use render; use render;
@ -52,12 +52,27 @@ macro_rules! idle_cb_call {
} }
#[derive(Debug, Clone, Copy)] #[derive(Debug, Clone, Copy)]
enum ResizeState { enum ResizeStateEnum {
NvimResizeTimer(glib::SourceId, usize, usize), NvimResizeTimer(usize, usize),
NvimResizeRequest(usize, usize), NvimResizeRequest(usize, usize),
Wait, Wait,
} }
pub struct ResizeState {
state: ResizeStateEnum,
timer: Option<glib::SourceId>,
}
impl ResizeState {
pub fn new() -> Self {
ResizeState {
state: ResizeStateEnum::Wait,
timer: None,
}
}
}
pub struct RenderState { pub struct RenderState {
pub font_ctx: render::Context, pub font_ctx: render::Context,
pub color_model: ColorModel, pub color_model: ColorModel,
@ -86,12 +101,12 @@ pub struct State {
render_state: Rc<RefCell<RenderState>>, render_state: Rc<RefCell<RenderState>>,
stack: gtk::Stack, stack: gtk::Stack,
drawing_area: gtk::DrawingArea, pub drawing_area: gtk::DrawingArea,
tabs: Tabline, tabs: Tabline,
im_context: gtk::IMMulticontext, im_context: gtk::IMMulticontext,
error_area: error::ErrorArea, error_area: error::ErrorArea,
resize_state: Rc<Cell<ResizeState>>, resize_state: Rc<RefCell<ResizeState>>,
options: ShellOptions, options: ShellOptions,
@ -124,7 +139,7 @@ impl State {
im_context: gtk::IMMulticontext::new(), im_context: gtk::IMMulticontext::new(),
error_area: error::ErrorArea::new(), error_area: error::ErrorArea::new(),
resize_state: Rc::new(Cell::new(ResizeState::Wait)), resize_state: Rc::new(RefCell::new(ResizeState::new())),
options, options,
@ -133,6 +148,13 @@ impl State {
} }
} }
/// Return NeovimRef only if vim in non blocking state
///
/// Note that this call also do neovim api call get_mode
pub fn nvim_non_blocked(&self) -> Option<NeovimRef> {
self.nvim().and_then(NeovimRef::non_blocked)
}
pub fn nvim(&self) -> Option<NeovimRef> { pub fn nvim(&self) -> Option<NeovimRef> {
self.nvim.nvim() self.nvim.nvim()
} }
@ -183,20 +205,20 @@ impl State {
pub fn open_file(&self, path: &str) { pub fn open_file(&self, path: &str) {
if let Some(mut nvim) = self.nvim() { if let Some(mut nvim) = self.nvim() {
nvim.command(&format!("e {}", path)).report_err(&mut *nvim); nvim.command(&format!("e {}", path)).report_err();
} }
} }
pub fn cd(&self, path: &str) { pub fn cd(&self, path: &str) {
if let Some(mut nvim) = self.nvim() { if let Some(mut nvim) = self.nvim() {
nvim.command(&format!("cd {}", path)).report_err(&mut *nvim); nvim.command(&format!("cd {}", path)).report_err();
} }
} }
fn close_popup_menu(&self) { fn close_popup_menu(&self) {
if self.popup_menu.is_open() { if self.popup_menu.is_open() {
if let Some(mut nvim) = self.nvim() { if let Some(mut nvim) = self.nvim() {
nvim.input("<Esc>").report_err(&mut *nvim); nvim.input("<Esc>").report_err();
} }
} }
} }
@ -282,24 +304,26 @@ impl State {
fn try_nvim_resize(&self) { fn try_nvim_resize(&self) {
let (columns, rows) = self.calc_nvim_size(); let (columns, rows) = self.calc_nvim_size();
let mut resize_state = self.resize_state.borrow_mut();
match self.resize_state.get() { match resize_state.state {
ResizeState::NvimResizeTimer(timer, req_columns, req_rows) => { ResizeStateEnum::NvimResizeTimer(req_columns, req_rows) => {
if req_columns == columns && req_rows == rows { if req_columns == columns && req_rows == rows {
return; return;
} }
glib::source_remove(timer); glib::source_remove(resize_state.timer.take().unwrap());
resize_state.state = ResizeStateEnum::Wait;
} }
ResizeState::NvimResizeRequest(req_columns, req_rows) => { ResizeStateEnum::NvimResizeRequest(req_columns, req_rows) => {
if req_columns == columns && req_rows == rows { if req_columns == columns && req_rows == rows {
return; return;
} }
} }
ResizeState::Wait => (), ResizeStateEnum::Wait => (),
} }
let resize_state = self.resize_state.clone(); let resize_state_ref = self.resize_state.clone();
let nvim = self.nvim.clone(); let nvim = self.nvim.clone();
@ -307,21 +331,19 @@ impl State {
return; return;
} }
self.resize_state.set(ResizeState::NvimResizeTimer( resize_state.state = ResizeStateEnum::NvimResizeTimer(columns, rows);
gtk::timeout_add(250, move || { resize_state.timer = Some(gtk::timeout_add(250, move || {
resize_state.set(ResizeState::NvimResizeRequest(columns, rows)); let mut resize_state = resize_state_ref.borrow_mut();
resize_state.state = ResizeStateEnum::NvimResizeRequest(columns, rows);
resize_state.timer = None;
if let Some(mut nvim) = nvim.nvim() { if let Some(mut nvim) = nvim.nvim().and_then(NeovimRef::non_blocked) {
if let Err(err) = nvim.ui_try_resize(columns as u64, rows as u64) { if let Err(err) = nvim.ui_try_resize(columns as u64, rows as u64) {
error!("Error trying resize nvim {}", err); error!("Error trying resize nvim {}", err);
}
} }
Continue(false) }
}), Continue(false)
columns, }));
rows,
));
} }
fn get_window(&self) -> gtk::Window { fn get_window(&self) -> gtk::Window {
@ -361,10 +383,10 @@ impl State {
render_state.mode.is(&mode::NvimMode::Normal) render_state.mode.is(&mode::NvimMode::Normal)
{ {
let paste_code = format!("normal! \"{}P", clipboard); let paste_code = format!("normal! \"{}P", clipboard);
nvim.command(&paste_code).report_err(&mut *nvim); nvim.command(&paste_code).report_err();
} else { } else {
let paste_code = format!("<C-r>{}", clipboard); let paste_code = format!("<C-r>{}", clipboard);
nvim.input(&paste_code).report_err(&mut *nvim); nvim.input(&paste_code).report_err();
}; };
} }
@ -373,11 +395,15 @@ impl State {
pub struct UiState { pub struct UiState {
mouse_pressed: bool, mouse_pressed: bool,
scroll_delta: (f64, f64),
} }
impl UiState { impl UiState {
pub fn new() -> UiState { pub fn new() -> UiState {
UiState { mouse_pressed: false } UiState {
mouse_pressed: false,
scroll_delta: (0.0, 0.0),
}
} }
} }
@ -385,13 +411,19 @@ impl UiState {
pub struct ShellOptions { pub struct ShellOptions {
nvim_bin_path: Option<String>, nvim_bin_path: Option<String>,
open_path: Option<String>, open_path: Option<String>,
timeout: Option<Duration>,
} }
impl ShellOptions { impl ShellOptions {
pub fn new(nvim_bin_path: Option<String>, open_path: Option<String>) -> Self { pub fn new(
nvim_bin_path: Option<String>,
open_path: Option<String>,
timeout: Option<Duration>,
) -> Self {
ShellOptions { ShellOptions {
nvim_bin_path, nvim_bin_path,
open_path, open_path,
timeout,
} }
} }
} }
@ -443,8 +475,8 @@ impl Shell {
state.drawing_area.set_events( state.drawing_area.set_events(
(gdk_sys::GDK_BUTTON_RELEASE_MASK | gdk_sys::GDK_BUTTON_PRESS_MASK | (gdk_sys::GDK_BUTTON_RELEASE_MASK | gdk_sys::GDK_BUTTON_PRESS_MASK |
gdk_sys::GDK_BUTTON_MOTION_MASK | gdk_sys::GDK_BUTTON_MOTION_MASK | gdk_sys::GDK_SCROLL_MASK |
gdk_sys::GDK_SCROLL_MASK) gdk_sys::GDK_SMOOTH_SCROLL_MASK)
.bits() as i32, .bits() as i32,
); );
@ -490,18 +522,19 @@ impl Shell {
let ref_state = self.state.clone(); let ref_state = self.state.clone();
state.drawing_area.connect_key_press_event(move |_, ev| { state.drawing_area.connect_key_press_event(move |_, ev| {
let mut shell = ref_state.borrow_mut(); ref_state
shell.cursor.as_mut().unwrap().reset_state(); .borrow_mut()
// GtkIMContext will eat a Shift-Space and not tell us about shift. .cursor
// Also don't let IME eat any GDK_KEY_KP_ events .as_mut()
if !ev.get_state().contains(gdk::SHIFT_MASK) && .unwrap()
ev.get_keyval() < gdk_sys::GDK_KEY_KP_Space as u32 && .reset_state();
ev.get_keyval() > gdk_sys::GDK_KEY_KP_Divide as u32 &&
shell.im_context.filter_keypress(ev) if ref_state.borrow().im_context.filter_keypress(ev) {
{
Inhibit(true) Inhibit(true)
} else { } else {
if let Some(mut nvim) = shell.nvim() { let state = ref_state.borrow();
let nvim = state.nvim();
if let Some(mut nvim) = nvim {
input::gtk_key_press(&mut nvim, ev) input::gtk_key_press(&mut nvim, ev)
} else { } else {
Inhibit(false) Inhibit(false)
@ -515,8 +548,13 @@ impl Shell {
}); });
let ref_state = self.state.clone(); let ref_state = self.state.clone();
let ref_ui_state = self.ui_state.clone();
state.drawing_area.connect_scroll_event(move |_, ev| { state.drawing_area.connect_scroll_event(move |_, ev| {
gtk_scroll_event(&mut *ref_state.borrow_mut(), ev) gtk_scroll_event(
&mut *ref_state.borrow_mut(),
&mut *ref_ui_state.borrow_mut(),
ev,
)
}); });
let ref_state = self.state.clone(); let ref_state = self.state.clone();
@ -596,7 +634,7 @@ impl Shell {
let nvim = state.nvim(); let nvim = state.nvim();
if let Some(mut nvim) = nvim { if let Some(mut nvim) = nvim {
nvim.command(":wa").report_err(&mut *nvim); nvim.command(":wa").report_err();
} }
} }
@ -626,9 +664,9 @@ impl Deref for Shell {
} }
fn gtk_focus_in(state: &mut State) -> Inhibit { fn gtk_focus_in(state: &mut State) -> Inhibit {
if let Some(mut nvim) = state.nvim() { if let Some(mut nvim) = state.nvim_non_blocked() {
nvim.command("if exists('#FocusGained') | doautocmd FocusGained | endif") nvim.command("if exists('#FocusGained') | doautocmd FocusGained | endif")
.report_err(&mut *nvim); .report_err();
} }
state.im_context.focus_in(); state.im_context.focus_in();
@ -639,9 +677,9 @@ fn gtk_focus_in(state: &mut State) -> Inhibit {
} }
fn gtk_focus_out(state: &mut State) -> Inhibit { fn gtk_focus_out(state: &mut State) -> Inhibit {
if let Some(mut nvim) = state.nvim() { if let Some(mut nvim) = state.nvim_non_blocked() {
nvim.command("if exists('#FocusLost') | doautocmd FocusLost | endif") nvim.command("if exists('#FocusLost') | doautocmd FocusLost | endif")
.report_err(&mut *nvim); .report_err();
} }
state.im_context.focus_out(); state.im_context.focus_out();
@ -652,26 +690,50 @@ fn gtk_focus_out(state: &mut State) -> Inhibit {
Inhibit(false) Inhibit(false)
} }
fn gtk_scroll_event(state: &mut State, ev: &EventScroll) -> Inhibit { fn gtk_scroll_event(state: &mut State, ui_state: &mut UiState, ev: &EventScroll) -> Inhibit {
if !state.mouse_enabled { if !state.mouse_enabled {
return Inhibit(false); return Inhibit(false);
} }
state.close_popup_menu(); state.close_popup_menu();
match ev.as_ref().direction { match ev.get_direction() {
gdk_sys::GdkScrollDirection::Right => { gdk::ScrollDirection::Right => {
mouse_input(state, "ScrollWheelRight", ev.get_state(), ev.get_position()) mouse_input(state, "ScrollWheelRight", ev.get_state(), ev.get_position())
} }
gdk_sys::GdkScrollDirection::Left => { gdk::ScrollDirection::Left => {
mouse_input(state, "ScrollWheelLeft", ev.get_state(), ev.get_position()) mouse_input(state, "ScrollWheelLeft", ev.get_state(), ev.get_position())
} }
gdk_sys::GdkScrollDirection::Up => { gdk::ScrollDirection::Up => {
mouse_input(state, "ScrollWheelUp", ev.get_state(), ev.get_position()) mouse_input(state, "ScrollWheelUp", ev.get_state(), ev.get_position())
} }
gdk_sys::GdkScrollDirection::Down => { gdk::ScrollDirection::Down => {
mouse_input(state, "ScrollWheelDown", ev.get_state(), ev.get_position()) mouse_input(state, "ScrollWheelDown", ev.get_state(), ev.get_position())
} }
gdk::ScrollDirection::Smooth => {
// Remember and accumulate scroll deltas, so slow scrolling still
// works.
ui_state.scroll_delta.0 += ev.as_ref().delta_x;
ui_state.scroll_delta.1 += ev.as_ref().delta_y;
// Perform scroll action for deltas with abs(delta) >= 1.
let x = ui_state.scroll_delta.0 as isize;
let y = ui_state.scroll_delta.1 as isize;
for _ in 0..x {
mouse_input(state, "ScrollWheelRight", ev.get_state(), ev.get_position())
}
for _ in 0..-x {
mouse_input(state, "ScrollWheelLeft", ev.get_state(), ev.get_position())
}
for _ in 0..y {
mouse_input(state, "ScrollWheelDown", ev.get_state(), ev.get_position())
}
for _ in 0..-y {
mouse_input(state, "ScrollWheelUp", ev.get_state(), ev.get_position())
}
// Subtract performed scroll deltas.
ui_state.scroll_delta.0 -= x as f64;
ui_state.scroll_delta.1 -= y as f64;
}
_ => (), _ => (),
} }
Inhibit(false) Inhibit(false)
@ -790,7 +852,11 @@ fn init_nvim_async(
rows: usize, rows: usize,
) { ) {
// execute nvim // execute nvim
let nvim = match nvim::start(state_arc.clone(), options.nvim_bin_path.as_ref()) { let nvim = match nvim::start(
state_arc.clone(),
options.nvim_bin_path.as_ref(),
options.timeout,
) {
Ok(nvim) => nvim, Ok(nvim) => nvim,
Err(err) => { Err(err) => {
show_nvim_start_error(&err, state_arc); show_nvim_start_error(&err, state_arc);
@ -873,7 +939,7 @@ fn set_nvim_initialized(state_arc: Arc<UiMutex<State>>) {
fn draw_initializing(state: &State, ctx: &cairo::Context) { fn draw_initializing(state: &State, ctx: &cairo::Context) {
let render_state = state.render_state.borrow(); let render_state = state.render_state.borrow();
let color_model = &render_state.color_model; let color_model = &render_state.color_model;
let layout = ctx.create_pango_layout(); let layout = pangocairo::functions::create_layout(ctx).unwrap();
let desc = render_state.font_ctx.font_description(); let desc = render_state.font_ctx.font_description();
let alloc = state.drawing_area.get_allocation(); let alloc = state.drawing_area.get_allocation();
@ -897,8 +963,8 @@ fn draw_initializing(state: &State, ctx: &cairo::Context) {
color_model.fg_color.1, color_model.fg_color.1,
color_model.fg_color.2, color_model.fg_color.2,
); );
ctx.update_pango_layout(&layout); pangocairo::functions::update_layout(ctx, &layout);
ctx.show_pango_layout(&layout); pangocairo::functions::show_layout(ctx, &layout);
ctx.move_to(x + width as f64, y); ctx.move_to(x + width as f64, y);
@ -917,9 +983,7 @@ fn init_nvim(state_ref: &Arc<UiMutex<State>>) {
if state.start_nvim_initialization() { if state.start_nvim_initialization() {
let (cols, rows) = state.calc_nvim_size(); let (cols, rows) = state.calc_nvim_size();
state.model = UiModel::new(rows as u64, cols as u64); state.model = UiModel::new(rows as u64, cols as u64);
state.resize_state.set( state.resize_state.borrow_mut().state = ResizeStateEnum::NvimResizeRequest(cols, rows);
ResizeState::NvimResizeRequest(cols, rows),
);
let state_arc = state_ref.clone(); let state_arc = state_ref.clone();
let options = state.options.clone(); let options = state.options.clone();
@ -951,16 +1015,17 @@ impl RedrawEvents for State {
} }
fn on_resize(&mut self, columns: u64, rows: u64) -> RepaintMode { fn on_resize(&mut self, columns: u64, rows: u64) -> RepaintMode {
match self.resize_state.get() { let state = self.resize_state.borrow().state.clone();
ResizeState::NvimResizeTimer(..) => { match state {
ResizeStateEnum::NvimResizeTimer(..) => {
if self.model.columns != columns as usize || self.model.rows != rows as usize { if self.model.columns != columns as usize || self.model.rows != rows as usize {
self.model = UiModel::new(rows, columns); self.model = UiModel::new(rows, columns);
} }
} }
ResizeState::Wait | ResizeStateEnum::Wait |
ResizeState::NvimResizeRequest(..) => { ResizeStateEnum::NvimResizeRequest(..) => {
if self.model.columns != columns as usize || self.model.rows != rows as usize { if self.model.columns != columns as usize || self.model.rows != rows as usize {
self.resize_state.set(ResizeState::Wait); self.resize_state.borrow_mut().state = ResizeStateEnum::Wait;
self.model = UiModel::new(rows, columns); self.model = UiModel::new(rows, columns);
self.resize_main_window(); self.resize_main_window();
} }
@ -1054,7 +1119,7 @@ impl RedrawEvents for State {
fn popupmenu_show( fn popupmenu_show(
&mut self, &mut self,
menu: Vec<Vec<String>>, menu: &[CompleteItem],
selected: i64, selected: i64,
row: u64, row: u64,
col: u64, col: u64,
@ -1073,6 +1138,7 @@ impl RedrawEvents for State {
y, y,
width, width,
height, height,
max_width: self.drawing_area.get_allocated_width() - 20,
}; };
self.popup_menu.show(context); self.popup_menu.show(context);

View File

@ -31,7 +31,7 @@ fn show_not_saved_dlg(comps: &UiMutex<Components>, shell: &Shell, changed_bufs:
.fold(String::new(), |acc, v| acc + v + "\n"); .fold(String::new(), |acc, v| acc + v + "\n");
changed_files.pop(); changed_files.pop();
let flags = gtk::DIALOG_MODAL | gtk::DIALOG_DESTROY_WITH_PARENT; let flags = gtk::DialogFlags::MODAL | gtk::DialogFlags::DESTROY_WITH_PARENT;
let dlg = MessageDialog::new( let dlg = MessageDialog::new(
Some(comps.borrow().window()), Some(comps.borrow().window()),
flags, flags,

View File

@ -1,2 +1,3 @@
pub mod pango; pub mod pango;
pub mod pangocairo;

View File

@ -5,15 +5,13 @@ use glib::translate::*;
pub struct Analysis<'a>(&'a pango_sys::PangoAnalysis); pub struct Analysis<'a>(&'a pango_sys::PangoAnalysis);
impl <'a> Analysis <'a> { impl<'a> Analysis<'a> {
pub fn from(analysis: &'a pango_sys::PangoAnalysis) -> Self { pub fn from(analysis: &'a pango_sys::PangoAnalysis) -> Self {
Analysis(analysis) Analysis(analysis)
} }
pub fn font(&self) -> pango::Font { pub fn font(&self) -> pango::Font {
unsafe { unsafe { from_glib_none(self.0.font) }
from_glib_none(self.0.font)
}
} }
pub fn to_glib_ptr(&self) -> *const pango_sys::PangoAnalysis { pub fn to_glib_ptr(&self) -> *const pango_sys::PangoAnalysis {

View File

@ -23,7 +23,7 @@ pub trait AttrIteratorFactory {
impl AttrIteratorFactory for pango::AttrList { impl AttrIteratorFactory for pango::AttrList {
fn get_iterator(&self) -> AttrIterator { fn get_iterator(&self) -> AttrIterator {
unsafe { unsafe {
from_glib_none(pango_sys::pango_attr_list_get_iterator( from_glib_full(pango_sys::pango_attr_list_get_iterator(
self.to_glib_none().0, self.to_glib_none().0,
)) ))
} }

View File

@ -22,9 +22,7 @@ glib_wrapper! {
impl Item { impl Item {
#[cfg(test)] #[cfg(test)]
pub fn new() -> Self { pub fn new() -> Self {
unsafe { unsafe { from_glib_full(pango_sys::pango_item_new()) }
from_glib_none(pango_sys::pango_item_new())
}
} }
pub fn analysis(&self) -> analysis::Analysis { pub fn analysis(&self) -> analysis::Analysis {
@ -32,6 +30,10 @@ impl Item {
} }
pub fn offset(&self) -> (usize, usize, usize) { pub fn offset(&self) -> (usize, usize, usize) {
(self.0.offset as usize, self.0.length as usize, self.0.num_chars as usize) (
self.0.offset as usize,
self.0.length as usize,
self.0.num_chars as usize,
)
} }
} }

View File

@ -10,6 +10,7 @@ use std::ptr;
use pango; use pango;
use pango_sys; use pango_sys;
use glib_ffi;
use glib::translate::*; use glib::translate::*;
@ -22,17 +23,26 @@ pub fn pango_itemize(
cached_iter: Option<&mut AttrIterator>, cached_iter: Option<&mut AttrIterator>,
) -> Vec<Item> { ) -> Vec<Item> {
unsafe { unsafe {
FromGlibPtrContainer::from_glib_container(pango_sys::pango_itemize( //FromGlibPtrContainer::from_glib_full(pango_sys::pango_itemize(
from_glib_full_as_vec(pango_sys::pango_itemize(
context.to_glib_none().0, context.to_glib_none().0,
text.as_ptr() as *const i8, text.as_ptr() as *const i8,
start_index as i32, start_index as i32,
length as i32, length as i32,
attrs.to_glib_none().0, attrs.to_glib_none().0,
cached_iter.map(|iter| iter.to_glib_none_mut().0).unwrap_or(ptr::null_mut()), cached_iter
.map(|iter| iter.to_glib_none_mut().0)
.unwrap_or(ptr::null_mut()),
)) ))
} }
} }
unsafe fn from_glib_full_as_vec(ptr: *mut glib_ffi::GList) -> Vec<Item> {
let num = glib_ffi::g_list_length(ptr) as usize;
FromGlibContainer::from_glib_full_num(ptr, num)
}
pub fn pango_shape( pub fn pango_shape(
text: &str, text: &str,
offset: usize, offset: usize,
@ -51,4 +61,3 @@ pub fn pango_shape(
); );
} }
} }

16
src/sys/pangocairo/mod.rs Normal file
View File

@ -0,0 +1,16 @@
use pango;
use cairo;
use pango_cairo_sys as ffi;
use glib::translate::*;
pub fn show_glyph_string(cr: &cairo::Context, font: &pango::Font, glyphs: &pango::GlyphString) {
unsafe {
ffi::pango_cairo_show_glyph_string(
mut_override(cr.to_glib_none().0),
font.to_glib_none().0,
mut_override(glyphs.to_glib_none().0),
);
}
}

View File

@ -5,6 +5,7 @@ use std::cell::RefCell;
use gtk; use gtk;
use gtk::prelude::*; use gtk::prelude::*;
use glib;
use glib::signal; use glib::signal;
use pango; use pango;
@ -34,7 +35,7 @@ impl State {
let target = &self.data[idx as usize]; let target = &self.data[idx as usize];
if Some(target) != self.selected.as_ref() { if Some(target) != self.selected.as_ref() {
if let Some(mut nvim) = self.nvim.as_ref().unwrap().nvim() { if let Some(mut nvim) = self.nvim.as_ref().unwrap().nvim() {
nvim.set_current_tabpage(target).report_err(&mut *nvim); nvim.set_current_tabpage(target).report_err();
} }
} }
} }
@ -43,7 +44,7 @@ impl State {
pub struct Tabline { pub struct Tabline {
tabs: gtk::Notebook, tabs: gtk::Notebook,
state: Rc<RefCell<State>>, state: Rc<RefCell<State>>,
switch_handler_id: u64, switch_handler_id: glib::SignalHandlerId,
} }
impl Tabline { impl Tabline {
@ -102,7 +103,7 @@ impl Tabline {
self.update_state(nvim, selected, tabs); self.update_state(nvim, selected, tabs);
signal::signal_handler_block(&self.tabs, self.switch_handler_id); signal::signal_handler_block(&self.tabs, &self.switch_handler_id);
let count = self.tabs.get_n_pages() as usize; let count = self.tabs.get_n_pages() as usize;
if count < tabs.len() { if count < tabs.len() {
@ -134,7 +135,7 @@ impl Tabline {
} }
} }
signal::signal_handler_unblock(&self.tabs, self.switch_handler_id); signal::signal_handler_unblock(&self.tabs, &self.switch_handler_id);
} }
} }

View File

@ -55,12 +55,16 @@ fn get_hl_color(map: &HashMap<&str, &Value>, color_name: &str) -> Option<Color>
fn get_hl_colors(nvim: &mut Neovim, hl: &str) -> (Option<Color>, Option<Color>) { fn get_hl_colors(nvim: &mut Neovim, hl: &str) -> (Option<Color>, Option<Color>) {
nvim.get_hl_by_name(hl, true) nvim.get_hl_by_name(hl, true)
.ok_and_report(nvim) .ok_and_report()
.and_then(|m| if let Some(m) = m.to_attrs_map_report() { .and_then(|m| if let Some(m) = m.to_attrs_map_report() {
Some(( let reverse = m.get("reverse").and_then(|v| v.as_bool()).unwrap_or(false);
get_hl_color(&m, "background"), let bg = get_hl_color(&m, "background");
get_hl_color(&m, "foreground"), let fg = get_hl_color(&m, "foreground");
)) if reverse {
Some((fg, bg))
} else {
Some((bg, fg))
}
} else { } else {
None None
}) })

View File

@ -6,9 +6,9 @@ use std::sync::Arc;
use gtk; use gtk;
use gtk_sys; use gtk_sys;
use gtk::prelude::*; use gtk::prelude::*;
use gtk::{ApplicationWindow, HeaderBar, ToolButton, Image, AboutDialog}; use gtk::{ApplicationWindow, HeaderBar, ToolButton, Image, AboutDialog, SettingsExt};
use gio::prelude::*; use gio::prelude::*;
use gio::{Menu, MenuExt, MenuItem, MenuItemExt, SimpleAction}; use gio::{Menu, MenuExt, MenuItem, SimpleAction};
use settings::Settings; use settings::Settings;
use shell::{Shell, ShellOptions}; use shell::{Shell, ShellOptions};
@ -105,6 +105,15 @@ impl Ui {
comps.window = Some(ApplicationWindow::new(app)); comps.window = Some(ApplicationWindow::new(app));
let window = comps.window.as_ref().unwrap(); let window = comps.window.as_ref().unwrap();
let prefer_dark_theme = env::var("NVIM_GTK_PREFER_DARK_THEME")
.map(|opt| opt.trim() == "1")
.unwrap_or(false);
if prefer_dark_theme {
if let Some(settings) = window.get_settings() {
settings.set_property_gtk_application_prefer_dark_theme(true);
}
}
// Client side decorations including the toolbar are disabled via NVIM_GTK_NO_HEADERBAR=1 // Client side decorations including the toolbar are disabled via NVIM_GTK_NO_HEADERBAR=1
let use_header_bar = env::var("NVIM_GTK_NO_HEADERBAR") let use_header_bar = env::var("NVIM_GTK_NO_HEADERBAR")
.map(|opt| opt.trim() != "1") .map(|opt| opt.trim() != "1")
@ -185,14 +194,16 @@ impl Ui {
let menu = Menu::new(); let menu = Menu::new();
let plugs = MenuItem::new("Plugins", None); let section = Menu::new();
plugs.set_detailed_action("app.Plugins"); section.append_item(&MenuItem::new("New Window", "app.new-window"));
menu.append_item(&plugs); menu.append_section(None, &section);
let about = MenuItem::new("About", None); let section = Menu::new();
about.set_detailed_action("app.HelpAbout"); section.append_item(&MenuItem::new("Plugins", "app.Plugins"));
menu.append_item(&about); section.append_item(&MenuItem::new("About", "app.HelpAbout"));
menu.append_section(None, &section);
menu.freeze();
app.set_app_menu(Some(&menu)); app.set_app_menu(Some(&menu));
let plugs_action = SimpleAction::new("Plugins", None); let plugs_action = SimpleAction::new("Plugins", None);

View File

@ -16,7 +16,7 @@ impl ValueMapExt for Vec<(Value, Value)> {
.ok_or_else(|| "Can't convert map key to string".to_owned()) .ok_or_else(|| "Can't convert map key to string".to_owned())
.map(|key| (key, &p.1)) .map(|key| (key, &p.1))
}) })
.collect::<Result<HashMap<&str, &Value>, String>>() .collect::<Result<HashMap<&str, &Value>, String>>()
} }