diff_edit: remove unnecessary settings argument

We already get the settings via the ui object here.
This commit is contained in:
Martin von Zweigbergk 2022-11-22 07:33:07 -08:00 committed by Martin von Zweigbergk
parent c7b90bbe1c
commit 7c99fa0750
2 changed files with 3 additions and 12 deletions

View file

@ -752,14 +752,7 @@ impl WorkspaceCommandHelper {
right_tree: &Tree,
instructions: &str,
) -> Result<TreeId, DiffEditError> {
crate::diff_edit::edit_diff(
ui,
&self.settings,
left_tree,
right_tree,
instructions,
self.base_ignores(),
)
crate::diff_edit::edit_diff(ui, left_tree, right_tree, instructions, self.base_ignores())
}
pub fn select_diff(
@ -774,7 +767,6 @@ impl WorkspaceCommandHelper {
if interactive {
Ok(crate::diff_edit::edit_diff(
ui,
&self.settings,
left_tree,
right_tree,
instructions,

View file

@ -98,7 +98,6 @@ fn set_readonly_recursively(path: &Path) -> Result<(), std::io::Error> {
pub fn edit_diff(
ui: &mut Ui,
settings: &UserSettings,
left_tree: &Tree,
right_tree: &Tree,
instructions: &str,
@ -147,7 +146,7 @@ pub fn edit_diff(
// TODO: Make this configuration have a table of possible editors and detect the
// best one here.
let editor_name = match settings.config().get_string("ui.diff-editor") {
let editor_name = match ui.settings().config().get_string("ui.diff-editor") {
Ok(editor_binary) => editor_binary,
Err(_) => {
let default_editor = "meld".to_string();
@ -159,7 +158,7 @@ pub fn edit_diff(
default_editor
}
};
let editor = get_tool(settings, &editor_name)?;
let editor = get_tool(ui.settings(), &editor_name)?;
// Start a diff editor on the two directories.
let exit_status = Command::new(&editor.program)
.args(&editor.edit_args)