diff --git a/fish-rust/src/builtins/string.rs b/fish-rust/src/builtins/string.rs index 1ba8f6c9c..5a7efc114 100644 --- a/fish-rust/src/builtins/string.rs +++ b/fish-rust/src/builtins/string.rs @@ -234,7 +234,7 @@ impl StringError { InvalidArgs(msg) => { streams.err.append(L!("string ")); // TODO: Once we can extract/edit translations in Rust files, replace this with - // something like wgettext_fmt("%ls: %ls", cmd, msg) that can be translated + // something like wgettext_fmt!("%ls: %ls\n", cmd, msg) that can be translated // and remove the forwarding of the cmd name to `parse_opt` streams.err.append(msg); } diff --git a/fish-rust/src/builtins/string/pad.rs b/fish-rust/src/builtins/string/pad.rs index 3238f042c..996ab67cd 100644 --- a/fish-rust/src/builtins/string/pad.rs +++ b/fish-rust/src/builtins/string/pad.rs @@ -72,13 +72,13 @@ impl StringSubCommand<'_> for Pad { ) -> Option { let mut max_width = 0usize; let mut inputs: Vec<(Cow<'args, wstr>, usize)> = Vec::new(); - let mut print_newline = true; + let mut print_trailing_newline = true; for (arg, want_newline) in Arguments::new(args, optind, streams) { let width = width_without_escapes(&arg, 0); max_width = max_width.max(width); inputs.push((arg, width)); - print_newline = want_newline; + print_trailing_newline = want_newline; } let pad_width = max_width.max(self.width); @@ -101,7 +101,7 @@ impl StringSubCommand<'_> for Pad { .collect(), }; - if print_newline { + if print_trailing_newline { padded.push('\n'); } diff --git a/fish-rust/src/builtins/string/repeat.rs b/fish-rust/src/builtins/string/repeat.rs index 84229171f..7859f6857 100644 --- a/fish-rust/src/builtins/string/repeat.rs +++ b/fish-rust/src/builtins/string/repeat.rs @@ -53,10 +53,10 @@ impl StringSubCommand<'_> for Repeat { let mut all_empty = true; let mut first = true; - let mut print_newline = true; + let mut print_trailing_newline = true; for (w, want_newline) in Arguments::new(args, optind, streams) { - print_newline = want_newline; + print_trailing_newline = want_newline; if w.is_empty() { continue; } @@ -132,7 +132,7 @@ impl StringSubCommand<'_> for Repeat { } // Historical behavior is to never append a newline if all strings were empty. - if !self.quiet && !self.no_newline && !all_empty && print_newline { + if !self.quiet && !self.no_newline && !all_empty && print_trailing_newline { streams.out.append1('\n'); }