ok/jj
1
0
Fork 0
forked from mirrors/jj

cli editor and pager: Add a comment

Follows up on 13c93d5270.

The information I added is explained in that commit's description, but
I feel like it could reduce confusion for future readers of the code.
This commit is contained in:
Ilya Grigoriev 2023-11-22 22:36:45 -08:00
parent 1ddcaa43b3
commit ea22f90018
2 changed files with 4 additions and 2 deletions

View file

@ -2296,6 +2296,7 @@ pub fn run_ui_editor(settings: &UserSettings, edit_path: &PathBuf) -> Result<(),
.map_err(|err| CommandError::ConfigError(format!("ui.editor: {err}")))?; .map_err(|err| CommandError::ConfigError(format!("ui.editor: {err}")))?;
let exit_status = editor.to_command().arg(edit_path).status().map_err(|err| { let exit_status = editor.to_command().arg(edit_path).status().map_err(|err| {
user_error(format!( user_error(format!(
// The executable couldn't be found or run; command-line arguments are not relevant
"Failed to run editor '{name}': {err}", "Failed to run editor '{name}': {err}",
name = editor.split_name(), name = editor.split_name(),
)) ))

View file

@ -218,10 +218,11 @@ impl Ui {
match self.output { match self.output {
UiOutput::Terminal { .. } if io::stdout().is_terminal() => { UiOutput::Terminal { .. } if io::stdout().is_terminal() => {
match UiOutput::new_paged(&self.pager_cmd) { match UiOutput::new_paged(&self.pager_cmd) {
Ok(new_output) => { Ok(pager_output) => {
self.output = new_output; self.output = pager_output;
} }
Err(e) => { Err(e) => {
// The pager executable couldn't be found or couldn't be run
writeln!( writeln!(
self.warning(), self.warning(),
"Failed to spawn pager '{name}': {e}", "Failed to spawn pager '{name}': {e}",