Fix the bug with delayed watcher value

This commit is contained in:
Sameer Rahmani 2023-06-18 14:55:10 +01:00
parent dd663d19a3
commit cdf3e9f059
Signed by: lxsameer
GPG Key ID: B0A4AF28AB9FD90B
2 changed files with 5 additions and 6 deletions

View File

@ -108,7 +108,8 @@ the show function."
(when (noether/-view-get view :managed?)
(with-current-buffer buf
(funcall show-fn)
(mapc #'funcall (get name :updaters))))
;;(mapc #'funcall (get name :updaters))
))
(posframe-show
buf

View File

@ -33,11 +33,10 @@
"Update the `noether/-line' variable after each command."
;; TODO: calling `line-number-at-pos' is not performant
;; replace this with a better alt
(message "here.... %s" (line-number-at-pos))
(set noether/-line (line-number-at-pos)))
(setq noether/-line (line-number-at-pos)))
(defun noether/-line-format (&rest _)
(format "%04d" noether/-line))
(defun noether/-line-format (_ v _ _)
(format "%04d" v))
(defview example-bar
@ -52,7 +51,6 @@
:name :line
:len 4
:init (lambda ()
(message "[len-unit-init]")
(add-hook 'post-command-hook #'noether/-update-line))
:var 'noether/-line
:fn #'noether/-line-format)))