Skip to content

Commit 9dd69dd

Browse files
committed
Solarized compatibility, use faint instead of bright black for secondary text
1 parent d96f17b commit 9dd69dd

4 files changed

Lines changed: 9 additions & 8 deletions

File tree

‎client/src/clojure_cli/repl/client.clj‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
(when-let [code (reader/form-at-cursor (.toString buf) (.cursor buf))]
183183
(let [{:keys [value err]} (api/eval-code code)]
184184
(api/print-above [{:text (str "=> " (or value err) "\n")
185-
:style {:fg :bright-black}}])))))))
185+
:style {:faint true}}])))))))
186186

187187
(defn doc-preview [text cap]
188188
(let [lines (str/split-lines text)]
@@ -197,7 +197,7 @@
197197
text (str/trim-newline (or doc ""))]
198198
(reset! doc-view {:token token :text text})
199199
(api/show-below [{:text (doc-preview text (quot (api/terminal-height) 4))
200-
:style {:fg :bright-black}}])))
200+
:style {:faint true}}])))
201201

202202
(defn doc-at-cursor
203203
"Widget previewing the doc for the token at the cursor.
@@ -244,7 +244,7 @@
244244
(str "…" (subs path (inc (- (count path) path-width))))
245245
path)]
246246
[{:text path :style {:fg :cyan :bold true}}
247-
{:text (str gap info) :style {:fg :bright-black}}]))
247+
{:text (str gap info) :style {:faint true}}]))
248248

249249
(defn body-rows [{:keys [leaf entries]} cursor]
250250
(if leaf
@@ -254,7 +254,7 @@
254254
(defn inspector-lines [{:keys [path info header] :as view} cursor cols footer]
255255
(let [head [(breadcrumb path info cols) [{:text header :style {:bold true}}]]
256256
body (body-rows view cursor)
257-
tail [[{:text ""}] [{:text (or footer (footer-text view)) :style {:fg :bright-black}}]]
257+
tail [[{:text ""}] [{:text (or footer (footer-text view)) :style {:faint true}}]]
258258
rows (reduce into [head body tail])]
259259
(mapv #(clamped-line cols %) rows)))
260260

@@ -390,7 +390,7 @@
390390
(defn print-echo [{:keys [code column] ns-name :ns} prompt-fn]
391391
(let [prompt (prompt-in prompt-fn ns-name)
392392
width (.columnLength ^AttributedString (last (.columnSplitLength (color/build-attrib-str prompt) Integer/MAX_VALUE)))]
393-
(api/print-above (conj prompt {:text (align code (or column 1) width) :style {:fg :bright-black}}))))
393+
(api/print-above (conj prompt {:text (align code (or column 1) width) :style {:faint true}}))))
394394

395395
(defn refresh-prompt [response ^LineReaderImpl rdr prompt-fn libspecs follow-ns?]
396396
(reset! api/last-response response)

‎client/src/clojure_cli/repl/color.clj‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@
3030
(defn build-style
3131
"Build a JLine AttributedStyle from a style map, nil values yield the default style."
3232
[style-map]
33-
(let [{:keys [fg bg bold italic underline inverse]} style-map
33+
(let [{:keys [fg bg bold faint italic underline inverse]} style-map
3434
fg-code (color-code fg)
3535
bg-code (color-code bg)]
3636
(cond-> AttributedStyle/DEFAULT
3737
fg-code (.foreground fg-code)
3838
bg-code (.background bg-code)
3939
bold (.bold)
40+
faint (.faint)
4041
italic (.italic)
4142
underline (.underline)
4243
inverse (.inverse))))

‎doc/prompts.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ A segment is a map of `:text` and an optional `:style`:
2323
{:text " => "}])
2424
```
2525

26-
Style keys: `:fg`, `:bg`, `:bold`, `:italic`, `:underline`, and `:inverse`.
26+
Style keys: `:fg`, `:bg`, `:bold`, `:faint`, `:italic`, `:underline`, and `:inverse`.
2727
Colors: `:black`, `:red`, `:green`, `:yellow`, `:blue`, `:magenta`, `:cyan`, `:white`,
2828
and their `:bright-*` variants or an xterm 256 value (0-255).
2929

‎examples/.cljconf/org.clojure/clojure-cli.repl/src/dev/full_width_prompt.clj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{:retro {:ns {:fg :bright-white :bg :blue}
1818
:ok {:fg :black :bg :green}
1919
:err {:fg :bright-white :bg :red}
20-
:time {:fg :bright-white :bg :bright-black}
20+
:time {:fg :black :bg :yellow}
2121
:heap {:fg :black :bg :cyan}
2222
:clock {:fg :bright-white :bg :magenta}
2323
:arrow {:fg :bright-green}}

0 commit comments

Comments
 (0)