mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-28 15:56:27 +00:00
Better colors for 256-term
This commit is contained in:
parent
f80e617147
commit
3fcc3a9c94
15
fzf
15
fzf
@ -240,22 +240,25 @@ if C.can_change_color?
|
|||||||
C.init_pair 1, 110, bg
|
C.init_pair 1, 110, bg
|
||||||
C.init_pair 2, fg, bg
|
C.init_pair 2, fg, bg
|
||||||
C.init_pair 3, 108, bg
|
C.init_pair 3, 108, bg
|
||||||
C.init_pair 4, 220, bg - 1
|
C.init_pair 4, fg + 2, bg - 1
|
||||||
C.init_pair 5, 151, bg - 1
|
C.init_pair 5, 151, bg - 1
|
||||||
C.init_pair 6, 148, bg + 1
|
C.init_pair 6, 148, bg + 1
|
||||||
C.init_pair 7, 144, bg + 1
|
C.init_pair 7, 144, bg + 1
|
||||||
|
C.init_pair 8, 161, bg - 1
|
||||||
else
|
else
|
||||||
C.init_pair 1, C::COLOR_BLUE, C::COLOR_BLACK
|
C.init_pair 1, C::COLOR_BLUE, C::COLOR_BLACK
|
||||||
C.init_pair 2, C::COLOR_WHITE, C::COLOR_BLACK
|
C.init_pair 2, C::COLOR_WHITE, C::COLOR_BLACK
|
||||||
C.init_pair 3, C::COLOR_CYAN, C::COLOR_BLACK
|
C.init_pair 3, C::COLOR_GREEN, C::COLOR_BLACK
|
||||||
C.init_pair 4, C::COLOR_YELLOW, C::COLOR_BLACK
|
C.init_pair 4, C::COLOR_YELLOW, C::COLOR_BLACK
|
||||||
C.init_pair 5, C::COLOR_CYAN, C::COLOR_BLACK
|
C.init_pair 5, C::COLOR_GREEN, C::COLOR_BLACK
|
||||||
C.init_pair 6, C::COLOR_GREEN, C::COLOR_BLACK
|
C.init_pair 6, C::COLOR_GREEN, C::COLOR_BLACK
|
||||||
C.init_pair 7, C::COLOR_WHITE, C::COLOR_BLACK
|
C.init_pair 7, C::COLOR_WHITE, C::COLOR_BLACK
|
||||||
|
C.init_pair 8, C::COLOR_RED, C::COLOR_BLACK
|
||||||
end
|
end
|
||||||
|
|
||||||
def color sym, bold = false
|
def color sym, bold = false
|
||||||
C.color_pair([:blue, :normal, :match, :chosen, :match!, :fan, :info].index(sym) + 1) |
|
C.color_pair([:blue, :normal, :match, :chosen,
|
||||||
|
:match!, :fan, :info, :red].index(sym) + 1) |
|
||||||
(bold ? C::A_BOLD : 0)
|
(bold ? C::A_BOLD : 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -418,8 +421,10 @@ searcher = Thread.new {
|
|||||||
|
|
||||||
C.setpos row, 0
|
C.setpos row, 0
|
||||||
C.clrtoeol
|
C.clrtoeol
|
||||||
|
cprint chosen ? '>' : ' ', color(:red, true)
|
||||||
|
cprint ' ', color(chosen ? :chosen : :normal)
|
||||||
|
|
||||||
C.attron basic
|
C.attron basic
|
||||||
C.addstr chosen ? '> ' : ' '
|
|
||||||
|
|
||||||
b, e = offset
|
b, e = offset
|
||||||
e = [e, maxc].min
|
e = [e, maxc].min
|
||||||
|
Loading…
Reference in New Issue
Block a user