aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorwojciechkepka2021-06-18 03:57:36 +0000
committerBlaž Hrastnik2021-06-18 08:42:38 +0000
commitbbefc1db63f7c3933adfd91fc404db9850af8399 (patch)
treedd993aab36ba1abb5d639512004ecd845cc4e115 /helix-term
parentd095ec15d4672ec5fb3b1f4a85282db31f40c6ea (diff)
Add an option to disable display of progress in status bar
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/application.rs8
-rw-r--r--helix-term/src/config.rs10
2 files changed, 16 insertions, 2 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index b2b49be5..aa2ce884 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -39,6 +39,7 @@ pub struct Application {
callbacks: LspCallbacks,
lsp_progress: LspProgressMap,
+ lsp_progress_enabled: bool,
}
impl Application {
@@ -77,6 +78,7 @@ impl Application {
callbacks: FuturesUnordered::new(),
lsp_progress: LspProgressMap::new(),
+ lsp_progress_enabled: config.global.lsp_progress,
};
Ok(app)
@@ -310,8 +312,10 @@ impl Application {
self.lsp_progress.update(server_id, token, work);
}
- self.editor.set_status(status);
- self.render();
+ if self.lsp_progress_enabled {
+ self.editor.set_status(status);
+ self.render();
+ }
}
_ => unreachable!(),
}
diff --git a/helix-term/src/config.rs b/helix-term/src/config.rs
index bd84e0b1..2b8b475b 100644
--- a/helix-term/src/config.rs
+++ b/helix-term/src/config.rs
@@ -6,12 +6,19 @@ use serde::{de::Error as SerdeError, Deserialize, Serialize};
use crate::keymap::{parse_keymaps, Keymaps};
#[derive(Default)]
+pub struct GlobalConfig {
+ pub lsp_progress: bool,
+}
+
+#[derive(Default)]
pub struct Config {
+ pub global: GlobalConfig,
pub keymaps: Keymaps,
}
#[derive(Serialize, Deserialize)]
struct TomlConfig {
+ lsp_progress: Option<bool>,
keys: Option<HashMap<String, HashMap<String, String>>>,
}
@@ -22,6 +29,9 @@ impl<'de> Deserialize<'de> for Config {
{
let config = TomlConfig::deserialize(deserializer)?;
Ok(Self {
+ global: GlobalConfig {
+ lsp_progress: config.lsp_progress.unwrap_or(true),
+ },
keymaps: config
.keys
.map(|r| parse_keymaps(&r))