Merge branch 'master' into ext_cmdline
This commit is contained in:
commit
49bb758c4b
14
src/shell.rs
14
src/shell.rs
@ -77,7 +77,10 @@ pub struct State {
|
|||||||
cmd_line: CmdLine,
|
cmd_line: CmdLine,
|
||||||
settings: Rc<RefCell<Settings>>,
|
settings: Rc<RefCell<Settings>>,
|
||||||
render_state: Rc<RefCell<RenderState>>,
|
render_state: Rc<RefCell<RenderState>>,
|
||||||
|
|
||||||
|
resize_request: (i64, i64),
|
||||||
resize_timer: Rc<Cell<Option<glib::SourceId>>>,
|
resize_timer: Rc<Cell<Option<glib::SourceId>>>,
|
||||||
|
|
||||||
pub clipboard_clipboard: gtk::Clipboard,
|
pub clipboard_clipboard: gtk::Clipboard,
|
||||||
pub clipboard_primary: gtk::Clipboard,
|
pub clipboard_primary: gtk::Clipboard,
|
||||||
|
|
||||||
@ -112,7 +115,10 @@ impl State {
|
|||||||
cmd_line,
|
cmd_line,
|
||||||
settings,
|
settings,
|
||||||
render_state,
|
render_state,
|
||||||
|
|
||||||
|
resize_request: (-1, -1),
|
||||||
resize_timer: Rc::new(Cell::new(None)),
|
resize_timer: Rc::new(Cell::new(None)),
|
||||||
|
|
||||||
clipboard_clipboard: gtk::Clipboard::get(&gdk::Atom::intern("CLIPBOARD")),
|
clipboard_clipboard: gtk::Clipboard::get(&gdk::Atom::intern("CLIPBOARD")),
|
||||||
clipboard_primary: gtk::Clipboard::get(&gdk::Atom::intern("PRIMARY")),
|
clipboard_primary: gtk::Clipboard::get(&gdk::Atom::intern("PRIMARY")),
|
||||||
|
|
||||||
@ -302,11 +308,19 @@ impl State {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let (requested_rows, requested_cols) = self.resize_request;
|
||||||
|
|
||||||
|
if requested_rows == rows as i64 && requested_cols == columns as i64 {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let resize_timer = self.resize_timer.take();
|
let resize_timer = self.resize_timer.take();
|
||||||
if let Some(resize_timer) = resize_timer {
|
if let Some(resize_timer) = resize_timer {
|
||||||
glib::source_remove(resize_timer);
|
glib::source_remove(resize_timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.resize_request = (rows as i64, columns as i64);
|
||||||
|
|
||||||
let nvim = self.nvim.clone();
|
let nvim = self.nvim.clone();
|
||||||
let resize_timer = self.resize_timer.clone();
|
let resize_timer = self.resize_timer.clone();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user