top | item 32673099

(no title)

LittlePeter | 3 years ago

You are right, I probably misunderstood. But now I am curious, what is the use case for formatting just a range of lines and not the entire file?

discuss

order

sph|3 years ago

Maybe formatting just the lines you've modified: on Emacs I'm a big fan of dtrt-indent, which fixes the indentation only on the lines you've modified, without breaking the style of the rest of the file. Great when collaborating on an open-source project. The default "format-on-save" setting would reformat the entire file, creating huge diffs for simple changes.

BenGosub|3 years ago

It's very handy for when you copy something in the editor and the file is not saved, you probably don't intend to save it, but you want to format the code, because it will be more readable.