Closed dcolascione closed 3 years ago
Modifying buffer text using with-silent-modifications can corrupt undo data. Let's preserve the modification flag this way instead.
diff --git a/ws-butler/ws-butler.el b/ws-butler/ws-butler.el index 997a48e7fd..2afed1aeac 100644 --- a/ws-butler/ws-butler.el +++ b/ws-butler/ws-butler.el @@ -263,7 +263,7 @@ ensure point doesn't jump due to white space trimming." (ws-butler-clear-properties) ;; go to saved line+col (when ws-butler-presave-coord - (with-silent-modifications + (progn (let (remaining-lines) (ws-butler-with-save (widen) @@ -273,7 +273,8 @@ ensure point doesn't jump due to white space trimming." (insert (make-string remaining-lines ?\n)))) (move-to-column (cadr ws-butler-presave-coord)) (when (< (current-column) (cadr ws-butler-presave-coord)) - (insert (caddr ws-butler-presave-coord)))))) + (insert (caddr ws-butler-presave-coord))) + (set-buffer-modified-p nil)))) (defun ws-butler-before-revert () "Clear `ws-butler-presave-coord'."
Wasn't this done here https://github.com/lewang/ws-butler/pull/37 ?
Huh, that's weird. I thought I was looking at the latest tree, but I guess I wasn't. Sorry for the noise.
Modifying buffer text using with-silent-modifications can corrupt undo data. Let's preserve the modification flag this way instead.