fish_indent: Collapse successive newlines#10325
Merged
faho merged 2 commits intofish-shell:masterfrom Feb 27, 2024
Merged
Conversation
This makes it so code like ```fish echo foo echo bar ``` is collapsed into ```fish echo foo echo bar ``` One empty line is allowed, more is overkill. We could also allow more than one for e.g. function endings.
faho
commented
Feb 26, 2024
| #CHECK: | ||
| #CHECK: {{ }}case alpha | ||
| #CHECK: {{ }}{{ }}echo sup | ||
| #CHECK: |
Member
Author
There was a problem hiding this comment.
I have to admit I am surprised by this change.
I'm not sure why it happens (do we synthesize an "end" token for this?), but honestly I'm okay with it.
Contributor
|
On Mon, Feb 26, 2024 at 07:26:15AM -0800, Fabian Boehm wrote:
This makes it so fish_indent turns a run of empty lines into one.
we are already pretty opinionated, so this looks fine to me
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This makes it so fish_indent turns a run of empty lines into one.
So if you have a file like
it will turn it into
but
is untouched.
As a special case, even a single newline at the beginning of a file, before any code, will be removed.
The second commit goes through our share/ to reformat our files according to the new style.
TODOs: