Malabarba / aggressive-indent-mode

Emacs minor mode that keeps your code always indented. More reliable than electric-indent-mode.
851 stars 36 forks source link

respect revert-buffer #124

Closed CeleritasCelery closed 5 years ago

CeleritasCelery commented 5 years ago

When auto-revert-mode is enabled, or the buffer is reverted, everything that changed gets added to aggressive-indent--changed-list, which means that they will all get reindented when the next command is executed.

This is particularly an issue when using version control and switching branches. large swatches of buffer are reindented all the time, really polluting the diffs.

I was able to solve this by clearing aggressive-indent--changed-list in after-revert-hook, but I am not sure if that is the best solution.

Malabarba commented 5 years ago

I think that's a fine solution. Reverting the buffer is a lot like opening a new file. Aggressive indent shouldn't mess with that.

Would you like to submit your change as a PR?

CeleritasCelery commented 5 years ago

sure