diff --git a/src/lazygitclj/core.clj b/src/lazygitclj/core.clj index e7eba43..55fee7a 100644 --- a/src/lazygitclj/core.clj +++ b/src/lazygitclj/core.clj @@ -2,6 +2,7 @@ "lazygitclj - A lazygit-inspired TUI for git." (:require [tui.core :as tui] [tui.events :as ev :refer [key=]] + [tui.terminal :as term] [lazygitclj.git :as git] [clojure.string :as str])) @@ -813,8 +814,9 @@ (defn main-grid-view "Render the main lazygit-style grid layout." - [model width height] + [model] (let [has-message? (some? (:message model)) + {:keys [width]} (term/get-terminal-size) narrow? (< width 70) content (if narrow? ;; NARROW: Single column stacked @@ -838,16 +840,16 @@ (main-view-panel model) (command-log-panel)]])] (if has-message? - [:col {:width width :height height :heights [1 :flex 1]} + [:col {:heights [1 :flex 1]} (message-view model) content (help-bar model)] - [:col {:width width :height height :heights [:flex 1]} + [:col {:heights [:flex 1]} content (help-bar model)]))) -(defn view [model {:keys [width height] :or {width 120 height 30}}] - (let [background (main-grid-view model width height)] +(defn view [model] + (let [background (main-grid-view model)] (cond ;; Help menu modal overlay (= (:menu-mode model) :help)