Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More robust indentation detect algorithm #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

franko
Copy link
Contributor

@franko franko commented Nov 20, 2020

I propose a new more robust algorithm to detect the indentation size. It reads the whole file and is not fooled if a few lines use a wrong indentation. It works by looking the distribution of indentation size and use a simple heuristics to determine the best guess.

I found it useful for files where the indentation size is not strictly respected.

@quadroli
Copy link
Contributor

Just a comment, kinda intrusive how it overrides my initially set tab width, but nevertheless, cool upgrade

@franko
Copy link
Contributor Author

franko commented Nov 25, 2020

I am open to amend its behavior if you have a suggestion.

@quadroli
Copy link
Contributor

nah, not really, just wanted to point that out, some people are really religious over their tab lengths

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