aboutsummaryrefslogtreecommitdiff
path: root/helix-view
diff options
context:
space:
mode:
authorKirawi2021-10-23 12:52:18 +0000
committerGitHub2021-10-23 12:52:18 +0000
commit0cb5e0b2caba61bbcf6f57ce58506882766d5eea (patch)
treed87c92ab1fcf969be89847e69ff4b370dfb4f2e7 /helix-view
parent0f886af4b993c836bb2d522f6e036362593ff8b8 (diff)
log syntax highlighting init errors (#895)
Diffstat (limited to 'helix-view')
-rw-r--r--helix-view/src/clipboard.rs22
-rw-r--r--helix-view/src/editor.rs6
2 files changed, 11 insertions, 17 deletions
diff --git a/helix-view/src/clipboard.rs b/helix-view/src/clipboard.rs
index a11224ac..a492652d 100644
--- a/helix-view/src/clipboard.rs
+++ b/helix-view/src/clipboard.rs
@@ -116,7 +116,7 @@ pub fn get_clipboard_provider() -> Box<dyn ClipboardProvider> {
}
} else {
#[cfg(target_os = "windows")]
- return Box::new(provider::WindowsProvider::new());
+ return Box::new(provider::WindowsProvider::default());
#[cfg(not(target_os = "windows"))]
return Box::new(provider::NopProvider::new());
@@ -145,15 +145,15 @@ mod provider {
use anyhow::{bail, Context as _, Result};
use std::borrow::Cow;
+ #[cfg(not(target_os = "windows"))]
#[derive(Debug)]
pub struct NopProvider {
buf: String,
primary_buf: String,
}
+ #[cfg(not(target_os = "windows"))]
impl NopProvider {
- #[allow(dead_code)]
- // Only dead_code on Windows.
pub fn new() -> Self {
Self {
buf: String::new(),
@@ -162,6 +162,7 @@ mod provider {
}
}
+ #[cfg(not(target_os = "windows"))]
impl ClipboardProvider for NopProvider {
fn name(&self) -> Cow<str> {
Cow::Borrowed("none")
@@ -186,19 +187,8 @@ mod provider {
}
#[cfg(target_os = "windows")]
- #[derive(Debug)]
- pub struct WindowsProvider {
- selection_buf: String,
- }
-
- #[cfg(target_os = "windows")]
- impl WindowsProvider {
- pub fn new() -> Self {
- Self {
- selection_buf: String::new(),
- }
- }
- }
+ #[derive(Default, Debug)]
+ pub struct WindowsProvider;
#[cfg(target_os = "windows")]
impl ClipboardProvider for WindowsProvider {
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 813c86fd..51fe8a42 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -294,7 +294,11 @@ impl Editor {
self.language_servers
.get(language)
.map_err(|e| {
- log::error!("Failed to get LSP, {}, for `{}`", e, language.scope())
+ log::error!(
+ "Failed to initialize the LSP for `{}` {{ {} }}",
+ language.scope(),
+ e
+ )
})
.ok()
});