mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
222673f339
Indented multiline commandlines look ugly in an external editor. Also, fish doesn't properly handle the case when the editor runs fish_indent. Fix is by indenting when exporting the commandline and un-indenting when importing the commandline again. Unindent only if the file is properly indented (meaning at least by the amount fish would use). Another complication is that we need to offset cursor positions by the indentation. This approach exposes "fish_indent --only-indent" and "--only-unindent" though I don't imagine they are useful for others so I'm not sure if this is the right place and whether we should even document it. One alternative is to add "commandline --indented" to handle indentation transparently. So "commandline --indented" would print a indented lines, and "commandline --indented 'if true' ' echo'" would remove the unecessary indentation before replacing the commandline. That would probably simplify the logic for the cursor position offset. |
||
---|---|---|
.. | ||
completions | ||
functions | ||
groff | ||
tools | ||
__fish_build_paths.fish.in | ||
config.fish |