docs: escape pipe in typeable command name (#13869)

pull/13872/head
David Crespo 2025-06-30 10:45:47 -05:00 committed by GitHub
parent 91dff9393d
commit e5f9937c1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -78,7 +78,7 @@
| `:log-open` | Open the helix log file. |
| `:insert-output` | Run shell command, inserting output before each selection. |
| `:append-output` | Run shell command, appending output after each selection. |
| `:pipe`, `:|` | Pipe each selection to the shell command. |
| `:pipe`, `:\|` | Pipe each selection to the shell command. |
| `:pipe-to` | Pipe each selection to the shell command, ignoring output. |
| `:run-shell-command`, `:sh`, `:!` | Run a shell command |
| `:reset-diff-change`, `:diffget`, `:diffg` | Reset the diff change at the cursor position. |

View File

@ -36,7 +36,8 @@ pub fn typable_commands() -> Result<String, DynError> {
"Description".to_owned(),
]));
let cmdify = |s: &str| format!("`:{}`", s);
// escape | so it doesn't get rendered as a column separator
let cmdify = |s: &str| format!("`:{}`", s.replace('|', "\\|"));
for cmd in TYPABLE_COMMAND_LIST {
let names = std::iter::once(&cmd.name)