formatting and clippy fixes

macos-click-through
Keith Simmons 3 years ago
parent bc8d002e32
commit 29668bb743

@ -4,7 +4,7 @@ use std::sync::Arc;
use log::error; use log::error;
use log::trace; use log::trace;
use nvim_rs::{Neovim, call_args, rpc::model::IntoVal}; use nvim_rs::{call_args, rpc::model::IntoVal, Neovim};
use tokio::sync::mpsc::{unbounded_channel, UnboundedReceiver}; use tokio::sync::mpsc::{unbounded_channel, UnboundedReceiver};
use crate::bridge::TxWrapper; use crate::bridge::TxWrapper;
@ -172,14 +172,11 @@ impl ParallelCommand {
nvim.command("\"lcd ~").await.ok(); nvim.command("\"lcd ~").await.ok();
nvim.command("file scratch").await.ok(); nvim.command("file scratch").await.ok();
nvim.call( nvim.call(
"nvim_buf_set_lines", "nvim_buf_set_lines",
call_args![ call_args![0i64, 0i64, -1i64, false, content],
0i64, )
0i64, .await
-1i64, .ok();
false,
content
]).await.ok();
} }
#[cfg(windows)] #[cfg(windows)]
ParallelCommand::RegisterRightClick => { ParallelCommand::RegisterRightClick => {

@ -422,7 +422,7 @@ impl Editor {
fn set_option(&mut self, gui_option: GuiOption) { fn set_option(&mut self, gui_option: GuiOption) {
trace!("Option set {:?}", &gui_option); trace!("Option set {:?}", &gui_option);
if let GuiOption::GuiFont(guifont) = gui_option { if let GuiOption::GuiFont(guifont) = gui_option {
if guifont == "*".to_owned() { if guifont == *"*" {
self.window_command_sender self.window_command_sender
.send(WindowCommand::ListAvailableFonts) .send(WindowCommand::ListAvailableFonts)
.ok(); .ok();

@ -88,7 +88,7 @@ impl GlutinWindowWrapper {
WindowCommand::TitleChanged(new_title) => self.handle_title_changed(new_title), WindowCommand::TitleChanged(new_title) => self.handle_title_changed(new_title),
WindowCommand::SetMouseEnabled(mouse_enabled) => { WindowCommand::SetMouseEnabled(mouse_enabled) => {
self.mouse_manager.enabled = mouse_enabled self.mouse_manager.enabled = mouse_enabled
}, }
WindowCommand::ListAvailableFonts => self.send_font_names(), WindowCommand::ListAvailableFonts => self.send_font_names(),
} }
} }
@ -101,7 +101,11 @@ impl GlutinWindowWrapper {
pub fn send_font_names(&self) { pub fn send_font_names(&self) {
let font_names = self.renderer.font_names(); let font_names = self.renderer.font_names();
self.ui_command_sender.send(UiCommand::Parallel(ParallelCommand::DisplayAvailableFonts(font_names))).unwrap(); self.ui_command_sender
.send(UiCommand::Parallel(ParallelCommand::DisplayAvailableFonts(
font_names,
)))
.unwrap();
} }
pub fn handle_quit(&mut self) { pub fn handle_quit(&mut self) {

Loading…
Cancel
Save