fix ginit error

macos-click-through
Keith Simmons 5 years ago
parent 5237a11cae
commit 18775f5d67

@ -92,8 +92,9 @@ async fn start_process(mut receiver: UnboundedReceiver<UiCommand>) {
options.set_rgb(true); options.set_rgb(true);
nvim.ui_attach(width as i64, height as i64, &options).await nvim.ui_attach(width as i64, height as i64, &options).await
.unwrap_or_explained_panic("Could not attach ui to neovim process"); .unwrap_or_explained_panic("Could not attach ui to neovim process");
nvim.command("runtime! ginit.vim").await if let Err(command_error) = nvim.command("runtime! ginit.vim").await {
.unwrap_or_explained_panic("Could not add ginit.vim to runtime"); nvim.command("echomsg \"error encountered in ginit.vim\"").await.ok();
}
info!("Neovim process attached"); info!("Neovim process attached");
let nvim = Arc::new(nvim); let nvim = Arc::new(nvim);

@ -186,7 +186,7 @@ impl CachingShaper {
} }
fn get_skia_font(&mut self, skribo_font: &SkriboFont) -> Option<&SkiaFont> { fn get_skia_font(&mut self, skribo_font: &SkriboFont) -> Option<&SkiaFont> {
let font_name = skribo_font.font.postscript_name().unwrap(); let font_name = skribo_font.font.postscript_name()?;
if !self.font_cache.contains(&font_name) { if !self.font_cache.contains(&font_name) {
let font = build_skia_font_from_skribo_font(skribo_font, self.base_size)?; let font = build_skia_font_from_skribo_font(skribo_font, self.base_size)?;
self.font_cache.put(font_name.clone(), font); self.font_cache.put(font_name.clone(), font);
@ -222,6 +222,8 @@ impl CachingShaper {
positions[i] = glyph.offset.x; positions[i] = glyph.offset.x;
} }
blobs.push(blob_builder.make().unwrap()); blobs.push(blob_builder.make().unwrap());
} else {
warn!("Could not load scribo font");
} }
} }

Loading…
Cancel
Save