1
0
mirror of https://codeberg.org/cage/tinmop/ synced 2025-01-23 03:29:56 +01:00

- forced resizing of suggestion window when terminal is resized.

This commit is contained in:
cage 2021-08-13 12:41:04 +02:00
parent 423779986a
commit 56b837c1fe
2 changed files with 21 additions and 17 deletions

View File

@ -127,7 +127,8 @@ be either `:keybinding' or `:string'. the former for key command the latter for
(error-message-attributes error-message-attributes) (error-message-attributes error-message-attributes)
(info-message-bg info-message-bg) (info-message-bg info-message-bg)
(info-message-fg info-message-fg) (info-message-fg info-message-fg)
(info-message-attributes info-message-attributes)) object (info-message-attributes info-message-attributes)
(suggestions-win suggestions-win)) object
(let* ((w (win-width *main-window*)) (let* ((w (win-width *main-window*))
(h +command-window-height+) (h +command-window-height+)
(x 0) (x 0)
@ -139,21 +140,23 @@ be either `:keybinding' or `:string'. the former for key command the latter for
(swconf:command-error-message-colors) (swconf:command-error-message-colors)
(multiple-value-bind (info-bg info-fg info-attributes) (multiple-value-bind (info-bg info-fg info-attributes)
(swconf:command-info-message-colors) (swconf:command-info-message-colors)
(setf error-message-bg error-bg) (setf error-message-bg error-bg)
(setf error-message-fg error-fg) (setf error-message-fg error-fg)
(setf error-message-attributes error-attributes) (setf error-message-attributes error-attributes)
(setf info-message-bg info-bg) (setf info-message-bg info-bg)
(setf info-message-fg info-fg) (setf info-message-fg info-fg)
(setf info-message-attributes info-attributes) (setf info-message-attributes info-attributes)
(setf (point-fg object) (win-bgcolor object)) (setf (point-fg object) (win-bgcolor object))
(setf (point-bg object) (win-fgcolor object)) (setf (point-bg object) (win-fgcolor object))
(setf (commands-separator object) (setf (commands-separator object)
(make-tui-string value (make-tui-string value
:fgcolor fg :fgcolor fg
:bgcolor bg)) :bgcolor bg))
(win-resize object w h) (win-resize object w h)
(win-move object x y) (win-move object x y)
object)))))) (when suggestions-win
(refresh-config suggestions-win))
object))))))
(defmethod calculate ((object command-window) dt) (defmethod calculate ((object command-window) dt)
(with-accessors ((suggestions-win suggestions-win)) object (with-accessors ((suggestions-win suggestions-win)) object
@ -560,6 +563,7 @@ command line."
(setf input-mode mode) (setf input-mode mode)
(when suggestions-win (when suggestions-win
(win-hide suggestions-win)) (win-hide suggestions-win))
(refresh-config suggestions-cached-win)
(setf suggestions-win suggestions-cached-win))) (setf suggestions-win suggestions-cached-win)))
(defmacro gen-set-mode-function (fn-name mode suggestions-cached-win) (defmacro gen-set-mode-function (fn-name mode suggestions-cached-win)

View File

@ -98,7 +98,7 @@
`(with-accessors ((,slot croatoan-window)) ,window `(with-accessors ((,slot croatoan-window)) ,window
,@body)) ,@body))
(defmacro when-window-shown ((window &key (min-valid-height 5) (min-valid-width 5)) &body body) (defmacro when-window-shown ((window &key (min-valid-height 2) (min-valid-width 2)) &body body)
(with-gensyms (height width) (with-gensyms (height width)
`(when ,window `(when ,window
(let ((,height (if (window-uses-border-p ,window) (let ((,height (if (window-uses-border-p ,window)