fish-shell/share
Johannes Altmanninger 222673f339 edit_command_buffer: send indented commandline to editor
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.
2024-04-15 08:32:31 +02:00
..
completions Teach fish_indent to only indent and unindent 2024-04-15 08:32:31 +02:00
functions edit_command_buffer: send indented commandline to editor 2024-04-15 08:32:31 +02:00
groff
tools nim prompt: Don't use test 2024-04-02 17:33:30 +02:00
__fish_build_paths.fish.in
config.fish Reformat share/**.fish with newlines collapsed 2024-02-27 16:25:01 +01:00