Do not modify the buffer if yapf provides no change.#30
Do not modify the buffer if yapf provides no change.#30ChengYuShun wants to merge 2 commits intoJorisE:masterfrom
Conversation
|
Hi @ChengYuShun Thanks for your interest in this package and your suggestion! I'm not sure I think it would be wise to add this check. I agree that this may lead to unnecessary edits, but only to the buffer. What do you think would be saved by not editing the buffer? |
|
I agree that the current approach perfectly fine, since given that |
|
Hi, I think I don't understand your usecase completely, you say: "If yapfify chooses to overwrite the buffer even when no changes are made, I will always have to save it again afterwards. ". |
|
The thing is that yapfify always overwrites the buffer, so the buffer is modified even if no actual changes were made. |
Currently the buffer being formatted will always be modified when
yapfify-regionis run. This patch simply checks whether any changes are made before modifying the buffer, avoiding unnecessary edits.