You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, it is nice to have format-all-region that only format one region of the buffer. However I am not sure how useful it is. I tried to archive formatting only the modified regions (as it is already available feature in vscode, neovim, etc) for large code base with legacy code.
I try to implement this feature with (after-change-functions) hook and format-all-region but it is not possible since format-all-region modifies the entire buffer anyway.
The text was updated successfully, but these errors were encountered:
xeechou
changed the title
format-all-region modifies entire buffer anyway.
How can we implement a format-modified-region with format-all-region
Oct 15, 2023
xeechou
changed the title
How can we implement a format-modified-region with format-all-region
How can we implement a format-modified-region with format-all-regionOct 15, 2023
it is not possible since format-all-region modifies the entire buffer anyway.
It should not modify the entire buffer. That sounds like a bug. Which formatter did you test it with?
I don't meant it changed actual "content" of the entire buffer. If you turned on highlight-changes-mode and run a format-all-région you will see. I am using clang-format
I found the only reliable way to format only changed lines is relying on output from diff. I created a small fmo-mode to apply format-all-region on only changed lines.
Hi, it is nice to have
format-all-region
that only format one region of the buffer. However I am not sure how useful it is. I tried to archive formatting only the modified regions (as it is already available feature in vscode, neovim, etc) for large code base with legacy code.I try to implement this feature with
(after-change-functions)
hook andformat-all-region
but it is not possible sinceformat-all-region
modifies the entire buffer anyway.I am wondering how we can archive the similar feature as in microsoft/vscode#104994 ?
The text was updated successfully, but these errors were encountered: