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 workaround broken groff man page config 2016-10-19 13:43:04 -07:00
tools nim prompt: Don't use test 2024-04-02 17:33:30 +02:00
__fish_build_paths.fish.in Rename "snippets" to "conf" internally, and document them as snippets 2016-04-06 09:33:09 +08:00
config.fish Reformat share/**.fish with newlines collapsed 2024-02-27 16:25:01 +01:00