Skip to content

Instantly share code, notes, and snippets.

@jamescherti
Last active July 30, 2024 18:06
Show Gist options
  • Select an option

  • Save jamescherti/e1f64d56dc1e6bffa2fcb9d2ae7b7a83 to your computer and use it in GitHub Desktop.

Select an option

Save jamescherti/e1f64d56dc1e6bffa2fcb9d2ae7b7a83 to your computer and use it in GitHub Desktop.
Emacs Vdiff: Synchronize the text-scale (font size) across all vdiff buffers
;; 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