ziglang / zig-mode

Zig mode for Emacs
GNU General Public License v3.0
166 stars 55 forks source link

Restore minor-mode-list across revert-buffer Calls in zig-format-buffer #71

Closed bgluzman closed 1 year ago

bgluzman commented 2 years ago

zig-format-buffer calls revert-buffer which ends up terminating minor modes like lsp. By saving the minor-mode-list context and then restoring it after the revert-buffer call (along with setting the PRESERVE-MODES parameter to true within the call), we are able to retain the minor modes (like lsp) across calls to zig-format-buffer.

I believe this addresses the issue pointed out in #49. This approach was inspired by this Github comment.

joachimschmidt557 commented 1 year ago

51 was merged a few weeks ago, which removes all usages of revert-buffer.