Merge branch 'fix-call-freeze2'

This commit is contained in:
daa 2018-01-05 23:13:40 +03:00
commit cb1a1fbece
4 changed files with 24 additions and 19 deletions

8
Cargo.lock generated
View File

@ -302,10 +302,10 @@ dependencies = [
[[package]]
name = "neovim-lib"
version = "0.5.0"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (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)",
"unix_socket 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -332,7 +332,7 @@ dependencies = [
"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)",
"neovim-lib 0.5.1 (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)",
@ -643,7 +643,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b"
"checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2"
"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.1 (registry+https://github.com/rust-lang/crates.io-index)" = "db5378fd4e5e33e3f3fd7d2d6519a6598fcb9b4c0c5959da1307e16241cef696"
"checksum num-traits 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "cacfcab5eb48250ee7d0c7896b51a2c5eec99c1feea5f32025635f5ae4b00070"
"checksum pango 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e81c404ab81ea7ea2fc2431a0a7672507b80e4b8bf4b41eac3fc83cc665104e"
"checksum pango-sys 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34f34a1be107fe16abb2744e0e206bee4b3b07460b5fddd3009a6aaf60bd69ab"

View File

@ -3,7 +3,7 @@ environment:
PROJECT_NAME: rustfmt
matrix:
- TARGET: x86_64-pc-windows-gnu
RUST_VERSION: 1.20.0
RUST_VERSION: 1.22.1
install:
# - ps: Start-FileDownload "https://static.rust-lang.org/dist/channel-rust-stable"

View File

@ -106,7 +106,7 @@ fn draw_underline(
let undercurl_height = (underline_thickness * 4.0).min(max_undercurl_height);
let undercurl_y = line_y + underline_position - undercurl_height / 2.0;
pangocairo::functions::error_underline_path(ctx, line_x, undercurl_y, char_width, undercurl_height);
pangocairo::functions::show_error_underline(ctx, line_x, undercurl_y, char_width, undercurl_height);
} else if cell.attrs.underline {
let fg = color_model.actual_cell_fg(cell);
ctx.set_source_rgb(fg.0, fg.1, fg.2);

View File

@ -15,7 +15,7 @@ use gtk;
use gtk::prelude::*;
use pangocairo;
use neovim_lib::{Neovim, NeovimApi, Value};
use neovim_lib::{Neovim, NeovimApi, NeovimApiAsync, Value};
use neovim_lib::neovim_api::Tabpage;
use settings::{Settings, FontSource};
@ -112,6 +112,7 @@ impl State {
/// Return NeovimRef only if vim in non blocking state
///
/// Note that this call also do neovim api call get_mode
#[allow(dead_code)]
pub fn nvim_non_blocked(&self) -> Option<NeovimRef> {
self.nvim().and_then(NeovimRef::non_blocked)
}
@ -268,10 +269,10 @@ impl State {
return;
}
if let Some(mut nvim) = self.nvim_non_blocked() {
if let Err(err) = nvim.ui_try_resize(columns as u64, rows as u64) {
error!("Error trying resize nvim {}", err);
}
if let Some(mut nvim) = self.nvim() {
nvim.ui_try_resize_async(columns as u64, rows as u64)
.cb(|r| r.report_err())
.call();
}
}
@ -280,10 +281,12 @@ impl State {
if let Some(mut nvim) = nvim {
if self.mode.is(&mode::NvimMode::Insert) || self.mode.is(&mode::NvimMode::Normal) {
let paste_code = format!("normal! \"{}P", clipboard);
nvim.command(&paste_code).report_err();
nvim.command_async(&paste_code)
.cb(|r| r.report_err())
.call();
} else {
let paste_code = format!("<C-r>{}", clipboard);
nvim.input(&paste_code).report_err();
nvim.input_async(&paste_code).cb(|r| r.report_err()).call();
};
}
@ -559,9 +562,10 @@ impl Deref for Shell {
}
fn gtk_focus_in(state: &mut State) -> Inhibit {
if let Some(mut nvim) = state.nvim_non_blocked() {
nvim.command("if exists('#FocusGained') | doautocmd FocusGained | endif")
.report_err();
if let Some(mut nvim) = state.nvim() {
nvim.command_async("if exists('#FocusGained') | doautocmd FocusGained | endif")
.cb(|r| r.report_err())
.call();
}
state.im_context.focus_in();
@ -572,9 +576,10 @@ fn gtk_focus_in(state: &mut State) -> Inhibit {
}
fn gtk_focus_out(state: &mut State) -> Inhibit {
if let Some(mut nvim) = state.nvim_non_blocked() {
nvim.command("if exists('#FocusLost') | doautocmd FocusLost | endif")
.report_err();
if let Some(mut nvim) = state.nvim() {
nvim.command_async("if exists('#FocusLost') | doautocmd FocusLost | endif")
.cb(|r| r.report_err())
.call();
}
state.im_context.focus_out();