Skip to content

Commit

Permalink
cli editor and pager: Add a comment
Browse files Browse the repository at this point in the history
Follows up on 13c93d5.

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.
  • Loading branch information
ilyagr committed Nov 23, 2023
1 parent 1ddcaa4 commit ea22f90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions cli/src/cli_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2296,6 +2296,7 @@ pub fn run_ui_editor(settings: &UserSettings, edit_path: &PathBuf) -> Result<(),
.map_err(|err| CommandError::ConfigError(format!("ui.editor: {err}")))?;
let exit_status = editor.to_command().arg(edit_path).status().map_err(|err| {
user_error(format!(
// The executable couldn't be found or run; command-line arguments are not relevant
"Failed to run editor '{name}': {err}",
name = editor.split_name(),
))
Expand Down
5 changes: 3 additions & 2 deletions cli/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,11 @@ impl Ui {
match self.output {
UiOutput::Terminal { .. } if io::stdout().is_terminal() => {
match UiOutput::new_paged(&self.pager_cmd) {
Ok(new_output) => {
self.output = new_output;
Ok(pager_output) => {
self.output = pager_output;
}
Err(e) => {
// The pager executable couldn't be found or couldn't be run
writeln!(
self.warning(),
"Failed to spawn pager '{name}': {e}",
Expand Down

0 comments on commit ea22f90

Please sign in to comment.