Skip to content

Commit

Permalink
fix(highlight): typo in the previous fix
Browse files Browse the repository at this point in the history
See #260.
  • Loading branch information
ggandor committed Jan 17, 2025
1 parent 50045fa commit 67d26a1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
14 changes: 7 additions & 7 deletions fnl/leap/highlight.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ so we set a temporary highlight on it to see where we are."
; Define LeapLabelDimmed.
(let [normal (vim.api.nvim_get_hl 0 {:name "Normal" :link false})
label* (vim.api.nvim_get_hl 0 {:name self.group.label :link false})]
; E.g., the old default color scheme (`vim`) does not define Normal at all.
; `bg` can be nil (transparent background), and e.g. the old default
; color scheme (`vim`) does not define Normal at all.
; Also, `nvim_get_hl()` apparently does not guarantee to return numeric
; values in the table (#260).
(when (and (= (type label*.bg) "number")
(= (type normal.bg) "number"))
(set label*.bg (blend label*.bg normal.bg 0.7)))
(when (and (= (type label*.fg) "number")
(= (type normal.fg) "number"))
(set label*.fg (blend label*.fg normal.bg 0.5)))
(when (= (type normal.bg) "number")
(when (= (type label*.bg) "number")
(set label*.bg (blend label*.bg normal.bg 0.7)))
(when (= (type label*.fg) "number")
(set label*.fg (blend label*.fg normal.bg 0.5))))
(vim.api.nvim_set_hl 0 self.group.label-dimmed label*))))


Expand Down
15 changes: 9 additions & 6 deletions lua/leap/highlight.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 67d26a1

Please sign in to comment.