Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a2ed40d348 | |||
| 65f7d184bc | |||
| a7773b77d1 | |||
| ca1e90f130 | |||
| e63230af71 |
+12
-4
@@ -6,6 +6,8 @@
|
|||||||
[lazygitclj.git :as git]
|
[lazygitclj.git :as git]
|
||||||
[clojure.string :as str]))
|
[clojure.string :as str]))
|
||||||
|
|
||||||
|
(def temp tui/run)
|
||||||
|
|
||||||
;; === Model ===
|
;; === Model ===
|
||||||
|
|
||||||
(defn load-git-data []
|
(defn load-git-data []
|
||||||
@@ -56,7 +58,7 @@
|
|||||||
s))
|
s))
|
||||||
|
|
||||||
(defn get-current-diff
|
(defn get-current-diff
|
||||||
"Get the diff for the currently selected item based on panel and cursor."
|
"Change doc string for test"
|
||||||
[model]
|
[model]
|
||||||
(let [panel (:panel model)
|
(let [panel (:panel model)
|
||||||
items (current-items model)
|
items (current-items model)
|
||||||
@@ -90,7 +92,8 @@
|
|||||||
;; === Update ===
|
;; === Update ===
|
||||||
|
|
||||||
(defn update-diff [model]
|
(defn update-diff [model]
|
||||||
(assoc model :diff (get-current-diff model)))
|
;; never update lol
|
||||||
|
model)
|
||||||
|
|
||||||
(defn initial-model []
|
(defn initial-model []
|
||||||
(let [base (merge
|
(let [base (merge
|
||||||
@@ -879,15 +882,20 @@
|
|||||||
:else
|
:else
|
||||||
background)))
|
background)))
|
||||||
|
|
||||||
|
(defn test-view-2 [& args]
|
||||||
|
[:box "foo"])
|
||||||
|
|
||||||
;; === Main ===
|
;; === Main ===
|
||||||
|
|
||||||
|
(def temp2 get-current-diff)
|
||||||
|
|
||||||
(defn -main [& _args]
|
(defn -main [& _args]
|
||||||
(if (git/repo-root)
|
(if (git/repo-root)
|
||||||
(do
|
(do
|
||||||
(println "Starting lazygitclj...")
|
(println (str "String with initial model: " (initial-model)))
|
||||||
(tui/run {:init (initial-model)
|
(tui/run {:init (initial-model)
|
||||||
:update update-model
|
:update update-model
|
||||||
:view view})
|
:view test-view-2})
|
||||||
(println "Goodbye!"))
|
(println "Goodbye!"))
|
||||||
(do
|
(do
|
||||||
(println "Error: Not a git repository")
|
(println "Error: Not a git repository")
|
||||||
|
|||||||
Reference in New Issue
Block a user