Run fish_indent on funcsave#8603
Run fish_indent on funcsave#8603kidonng wants to merge 2 commits intofish-shell:masterfrom kidonng:patch-8
fish_indent on funcsave#8603Conversation
|
I'm not sure about this one. If I enter a function a certain way interactively, can see it that way with 'functions', might I be a little surprised to find something different written to disk? |
|
Interestingly,
But the functions is clearly not autoloaded: $ function t; end
$ functions -Dv t
stdin
n/a
0
scope-shadowing
n/aIs the manpage wrong, or the function can be made autoloaded later via some magic I don't know? If the latter is true, then the function shown in Ideally fish will automatically run
|
I don't see where you ran |
|
Okay, it seems we don't want to do this. Sorry! |
@faho would you be happy to accept a PR to add the functionality behind a flag (e.g. |
Right, that's the initial motivation of this PR. I got tired of having to run |
|
I haven't found time to think about this.
As a workaround, how about teaching your editor to run fish_indent when you save a *.fish file?
|
Actually my main editor (VSCode) is already configured so (via https://marketplace.visualstudio.com/items?itemName=bmalehorn.vscode-fish), however I have the issue when defining it interactively (as demonstrated by @floam above). |
This means that in case no editor is defined, "fish_indent" is now required to fix the indentation. Fixes fish-shell#8603
This means that in case no editor is defined, "fish_indent" is now required to fix the indentation. Fixes fish-shell#8603
|
this should be addressed by #10437 which makes |
This means that in case no editor is defined, "fish_indent" is now required to fix the indentation. Fixes #8603
This means that in case no editor is defined, "fish_indent" is now required to fix the indentation. Fixes fish-shell#8603

Description
funcedalready runfish_indentwhen the editor is fish:fish-shell/share/functions/funced.fish
Lines 61 to 75 in f254692
It makes sense to have
funcsaverun it as well.Maybe we should also run
fish_indentafterfuncedfinishes?TODOs: