emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/osm 7a50000e1e 58/77: Add separate resize function, re


From: ELPA Syncer
Subject: [elpa] externals/osm 7a50000e1e 58/77: Add separate resize function, revert tile cache
Date: Mon, 7 Mar 2022 08:58:08 -0500 (EST)

branch: externals/osm
commit 7a50000e1ee01eff4c18a7221fcd2d1e31cc7b3d
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Add separate resize function, revert tile cache
---
 osm.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/osm.el b/osm.el
index 0dd3b9084c..8bdd572e2e 100644
--- a/osm.el
+++ b/osm.el
@@ -487,7 +487,7 @@ Should be at least 7 days according to the server usage 
policies."
               mwheel-scroll-left-function #'osm-left
               mwheel-scroll-right-function #'osm-right
               bookmark-make-record-function #'osm--make-bookmark)
-  (add-hook 'window-size-change-functions #'osm--revert nil 'local))
+  (add-hook 'window-size-change-functions #'osm--resize nil 'local))
 
 (defun osm--get-tile (x y)
   "Get tile at X/Y."
@@ -539,6 +539,12 @@ Should be at least 7 days according to the server usage 
policies."
 
 (defun osm--revert (&rest _)
   "Revert buffer."
+  (when (eq major-mode #'osm-mode)
+    (when osm--tiles (clrhash osm--tiles))
+    (osm--update)))
+
+(defun osm--resize (&rest _)
+  "Resize buffer."
   (when (eq major-mode #'osm-mode)
     (osm--update)))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]