Skip to content

Conversation

@Konfekt
Copy link
Contributor

@Konfekt Konfekt commented Mar 3, 2024

addresses #4

@timakro
Copy link
Owner

timakro commented Mar 4, 2024

I think the intent was to fall back to user preferences or file-type defaults in the case of a unrealistically large indentation?

For example, given a file like this

curl https://example.com/ -H "Content-Type: application/json" \
                          -H "Accept: application/json"

you wouldn't want to set shiftwidth and and softtabstop to 8, right?

You probably had something more like de2fd6c in mind.

@Konfekt
Copy link
Contributor Author

Konfekt commented Mar 4, 2024

Yes, such an example. User preferences are fine as well. I was not sure whether you preferred a max value instead.
While at it, I noticed that some computation are only needed in special cases and moved them inside if clauses

@timakro
Copy link
Owner

timakro commented Mar 4, 2024

I don't mean to make the maximum indentation value configurable, sorry for the confusion. I think 8 is good. I was trying to say that your PR would change shiftwidth and softtabstop given my example file while the intent as I understand it is to not change those settings in this scenario.

@Konfekt
Copy link
Contributor Author

Konfekt commented Mar 4, 2024

Yes, counting only up to 8 is a better solution, thank you.
I adapted this PR accordingly, if there's still interest.

Edit: indent is computed relative to the last indent

@Konfekt Konfekt mentioned this pull request Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants