justinbarclay / parinfer-rust-mode

Simplifying how you write Lisp
https://shaunlebron.github.io/parinfer/
GNU General Public License v3.0
227 stars 16 forks source link

fix: prevent buffer jump when safe strategy fails #96

Closed AjaiKN closed 2 months ago

AjaiKN commented 2 months ago

When replace-buffer-contents fails to do a non-destructive replacement within the allotted time/cost, it basically follows the fast strategy, except unlike the fast strategy, it doesn't try to prevent the window from jumping.

So in addition to doing the window adjustment in the fast strategy, we can also do it for the safe strategy when it fails and returns nil.

justinbarclay commented 2 months ago

Hey, this looks great. Thanks for the PR 😄