diff --git a/org-ql-agenda.el b/org-ql-agenda.el index 54644a1..be44798 100644 --- a/org-ql-agenda.el +++ b/org-ql-agenda.el @@ -296,10 +296,10 @@ the `match' item in the custom command form." (query-formatted (propertize (org-ql-agenda--font-lock-string 'emacs-lisp-mode query-formatted) 'help-echo query-formatted)) (query-width (length query-formatted)) - (available-width (- (window-width) - (length "In: ") - (length "Query: ") - query-width 4)) + (available-width (max 0 (- (window-width) + (length "In: ") + (length "Query: ") + query-width 4))) (buffers-files-formatted (format "%S" buffers-files)) (buffers-files-formatted (propertize (->> buffers-files-formatted (org-ql-agenda--font-lock-string 'emacs-lisp-mode)