Skip to content

Commit

Permalink
feat: add show-command-doc? config
Browse files Browse the repository at this point in the history
  • Loading branch information
thezjy authored and tiensonqin committed Jun 17, 2021
1 parent c123f97 commit 9e3c197
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/frontend/components/editor.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
(fn [item]
(let [command-name (first item)
command-doc (get item 2)]
[:div {:title command-doc} command-name]))
[:div {:title (when (state/show-command-doc?) command-doc)} command-name]))

:on-chosen
(fn [chosen-item]
Expand Down
8 changes: 7 additions & 1 deletion src/main/frontend/state.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@
;; (remove #(= leader-parent %)))]
;; (prn "followers: " (count followers))
;; ))
)))
)))

(defn get-edit-input-id
[]
Expand Down Expand Up @@ -1060,6 +1060,12 @@
:ui/enable-tooltip?
true))

(defn show-command-doc?
[]
(get (get (sub-config) (get-current-repo))
:ui/show-command-doc?
true))

(defn set-config!
[repo-url value]
(set-state! [:config repo-url] value))
Expand Down
2 changes: 2 additions & 0 deletions templates/config.edn
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
;; :editor/down ["ctrl+j" "down"]
;; :editor/left ["ctrl+h" "left"]
;; :editor/right ["ctrl+l" "right"]}
;; Whether to show command doc on hover
:ui/show-command-doc? true

;; The app will show those queries in today's journal page,
;; the "NOW" query asks the tasks which need to be finished "now",
Expand Down

0 comments on commit 9e3c197

Please sign in to comment.