Last active
July 30, 2024 18:06
-
-
Save jamescherti/e1f64d56dc1e6bffa2fcb9d2ae7b7a83 to your computer and use it in GitHub Desktop.
Emacs Vdiff: Synchronize the text-scale (font size) across all vdiff buffers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; Description: Emacs Vdiff: Synchronize the text-scale (font size) across all vdiff buffers | |
| ;; Gits URL: https://gist.github.com/jamescherti/e1f64d56dc1e6bffa2fcb9d2ae7b7a83 | |
| ;; License: MIT | |
| ;; Author: James Cherti | |
| (defun my-vdiff-sync-text-scale (&rest args) | |
| "Synchronize the text-scale (font size) across all vdiff buffers." | |
| (when (bound-and-true-p vdiff-mode) | |
| (let ((ts-amount text-scale-mode-amount)) | |
| (dolist (window (vdiff--all-windows)) | |
| (with-selected-window window | |
| (when (/= ts-amount text-scale-mode-amount) | |
| (text-scale-set ts-amount))))))) | |
| (advice-add 'text-scale-mode :after #'my-vdiff-sync-text-scale) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment