Skip to content

Commit

Permalink
fix: echobar mess window config
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Jun 23, 2024
1 parent 6f76e9e commit ec02ec6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions jcs-echobar.el
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
(add-hook 'post-command-hook #'keycast--update t)
(add-hook 'minibuffer-exit-hook #'keycast--minibuffer-exit t)
(advice-add 'keycast--update :after #'jcs-echobar--keycast-update))
(add-hook 'pre-command-hook #'jcs-echo-bar--pre-command)
(add-hook 'window-size-change-functions #'jcs-echobar--window-resize)
(jcs-echobar--window-resize) ; call it manually once
(setq jcs-echobar--default-function echo-bar-function)
Expand All @@ -82,6 +83,7 @@
(remove-hook 'post-command-hook #'keycast--update)
(remove-hook 'minibuffer-exit-hook #'keycast--minibuffer-exit)
(advice-remove 'keycast--update #'jcs-echobar--keycast-update))
(remove-hook 'pre-command-hook #'jcs-echo-bar--pre-command)
(remove-hook 'window-size-change-functions #'jcs-echobar--window-resize)
(setq echo-bar-function jcs-echobar--default-function)
(echo-bar-mode -1))
Expand Down Expand Up @@ -114,6 +116,14 @@
;; (@* "Core" )
;;

(defun jcs-echo-bar--pre-command ()
"Pre command hook."
(when echo-bar-mode
(dolist (ov echo-bar-overlays)
(when-let* ((str (overlay-get ov 'after-string))
(_ (string-match-p "\n" str))) ; if multilinek
(message nil)))))

(defvar jcs-echobar--render nil)

(defun jcs-echobar--render-width ()
Expand Down

0 comments on commit ec02ec6

Please sign in to comment.