Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Enable inline-git-blame by default (#10632)

Thorsten Ballc015b5c4cdf0
diff --git a/assets/settings/default.json b/assets/settings/default.json
index dcdb2e89d9a..e34062dd5a4 100644
--- a/assets/settings/default.json
+++ b/assets/settings/default.json
@@ -172,7 +172,7 @@
},
// The number of lines to keep above/below the cursor when scrolling.
"vertical_scroll_margin": 3,
- // Scroll sensitivity multiplier. This multiplier is applied
+ // Scroll sensitivity multiplier. This multiplier is applied
// to both the horizontal and vertical delta values while scrolling.
"scroll_sensitivity": 1.0,
"relative_line_numbers": false,
@@ -398,7 +398,7 @@
// Control whether the git blame information is shown inline,
// in the currently focused line.
"inline_blame": {
- "enabled": false
+ "enabled": true
// Sets a delay after which the inline blame information is shown.
// Delay is restarted with every cursor movement.
// "delay_ms": 600
diff --git a/crates/collab/src/tests/editor_tests.rs b/crates/collab/src/tests/editor_tests.rs
index 7ec5c84042f..99ef30b21c3 100644
--- a/crates/collab/src/tests/editor_tests.rs
+++ b/crates/collab/src/tests/editor_tests.rs
@@ -18,7 +18,10 @@ use language::{
language_settings::{AllLanguageSettings, InlayHintSettings},
FakeLspAdapter,
};
-use project::SERVER_PROGRESS_DEBOUNCE_TIMEOUT;
+use project::{
+ project_settings::{InlineBlameSettings, ProjectSettings},
+ SERVER_PROGRESS_DEBOUNCE_TIMEOUT,
+};
use rpc::RECEIVE_TIMEOUT;
use serde_json::json;
use settings::SettingsStore;
@@ -1999,6 +2002,25 @@ async fn test_git_blame_is_forwarded(cx_a: &mut TestAppContext, cx_b: &mut TestA
cx_a.update(editor::init);
cx_b.update(editor::init);
+ // Turn inline-blame-off by default so no state is transferred without us explicitly doing so
+ let inline_blame_off_settings = Some(InlineBlameSettings {
+ enabled: false,
+ delay_ms: None,
+ });
+ cx_a.update(|cx| {
+ cx.update_global(|store: &mut SettingsStore, cx| {
+ store.update_user_settings::<ProjectSettings>(cx, |settings| {
+ settings.git.inline_blame = inline_blame_off_settings;
+ });
+ });
+ });
+ cx_b.update(|cx| {
+ cx.update_global(|store: &mut SettingsStore, cx| {
+ store.update_user_settings::<ProjectSettings>(cx, |settings| {
+ settings.git.inline_blame = inline_blame_off_settings;
+ });
+ });
+ });
client_a
.fs()
diff --git a/crates/project/src/project_settings.rs b/crates/project/src/project_settings.rs
index 863ea7fdbbe..579c8e61567 100644
--- a/crates/project/src/project_settings.rs
+++ b/crates/project/src/project_settings.rs
@@ -71,7 +71,8 @@ pub struct InlineBlameSettings {
/// Whether or not to show git blame data inline in
/// the currently focused line.
///
- /// Default: false
+ /// Default: true
+ #[serde(default = "true_value")]
pub enabled: bool,
/// Whether to only show the inline blame information
/// after a delay once the cursor stops moving.
@@ -80,6 +81,10 @@ pub struct InlineBlameSettings {
pub delay_ms: Option<u64>,
}
+const fn true_value() -> bool {
+ true
+}
+
#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, Eq, JsonSchema)]
pub struct BinarySettings {
pub path: Option<String>,