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:
parent
1ddcaa43b3
commit
ea22f90018
2 changed files with 4 additions and 2 deletions
|
@ -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(),
|
||||
))
|
||||
|
|
|
@ -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}",
|
||||
|
|
Loading…
Reference in a new issue