From 5d628265888458cf117316ac283768563b8fbe46 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Fri, 1 Mar 2024 15:33:45 +0900 Subject: [PATCH] merge_tools: move "ui.diff-instructions" to CLI and config/misc.toml There are no users of this option in jj-lib. Let's simplify it. --- cli/src/config/misc.toml | 1 + cli/src/merge_tools/mod.rs | 2 +- lib/src/settings.rs | 4 ---- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/cli/src/config/misc.toml b/cli/src/config/misc.toml index e247778fdc..c3daf74b99 100644 --- a/cli/src/config/misc.toml +++ b/cli/src/config/misc.toml @@ -5,6 +5,7 @@ tree-level-conflicts = true [ui] +diff-instructions = true paginate = "auto" pager = { command = ["less", "-FRX"], env = { LESSCHARSET = "utf-8" } } log-word-wrap = false diff --git a/cli/src/merge_tools/mod.rs b/cli/src/merge_tools/mod.rs index e452134fb3..91961e0b72 100644 --- a/cli/src/merge_tools/mod.rs +++ b/cli/src/merge_tools/mod.rs @@ -182,7 +182,7 @@ impl DiffEditor { Ok(DiffEditor { tool, base_ignores, - use_instructions: settings.diff_instructions(), + use_instructions: settings.config().get_bool("ui.diff-instructions")?, }) } diff --git a/lib/src/settings.rs b/lib/src/settings.rs index 6b4653f223..8ab207bcc4 100644 --- a/lib/src/settings.rs +++ b/lib/src/settings.rs @@ -228,10 +228,6 @@ impl UserSettings { .unwrap_or(false) } - pub fn diff_instructions(&self) -> bool { - self.config.get_bool("ui.diff-instructions").unwrap_or(true) - } - pub fn config(&self) -> &config::Config { &self.config }