lite-plugins icon indicating copy to clipboard operation
lite-plugins copied to clipboard

More robust indentation detect algorithm

Open franko opened this issue 3 years ago • 3 comments

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.

franko avatar Nov 20 '20 21:11 franko

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

quadroli avatar Nov 25 '20 10:11 quadroli

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

franko avatar Nov 25 '20 12:11 franko

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

quadroli avatar Nov 25 '20 13:11 quadroli