Skip to content

Commit 3411a62

Browse files
A-Lamiamehalter
authored andcommitted
feat(telescope): initial restructure to support prompt background
1 parent 5ab2612 commit 3411a62

File tree

3 files changed

+93
-17
lines changed

3 files changed

+93
-17
lines changed

lua/astrotheme/groups/plugins/telescope.lua

Lines changed: 85 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,106 @@
1-
local function callback()
1+
local function callback(opts)
2+
local title = {
3+
fg = (opts.title_invert and C.ui.float) or C.ui.title,
4+
bg = (opts.title_invert and C.ui.title)
5+
or (opts.inactive and C.ui.base)
6+
or (opts.transparent and opts.float and C.ui.base)
7+
or (opts.float and C.ui.float)
8+
or (opts.transparent and C.none)
9+
or C.ui.base,
10+
blend = vim.o.winblend or 0,
11+
bold = true,
12+
}
13+
14+
local normal = {
15+
fg = C.ui.text,
16+
bg = (opts.inactive and C.ui.base)
17+
or (opts.transparent and opts.float and C.ui.base)
18+
or (opts.float and C.ui.float)
19+
or (opts.transparent and C.none)
20+
or C.ui.base,
21+
blend = vim.o.winblend or 0,
22+
}
23+
24+
local border = {
25+
fg = (opts.border and C.ui.border) or (opts.inactive and C.ui.base) or (opts.float and C.ui.float) or C.ui.base,
26+
bg = (opts.border and opts.inactive and C.ui.base)
27+
or (opts.transparent and opts.float and C.ui.base)
28+
or (opts.float and C.ui.float)
29+
or (opts.transparent and C.none)
30+
or C.ui.base,
31+
blend = vim.o.winblend or 0,
32+
}
33+
234
return {
335
----------------
436
--- Title
537
----------------
6-
TelescopeTitle = { link = "PopupTitle" },
7-
TelescopeResultsTitle = { link = "TelescopeTitle" },
8-
TelescopePromptTitle = { link = "TelescopeTitle" },
9-
TelescopePreviewTitle = { link = "TelescopeTitle" },
38+
39+
TelescopePromptTitle = {
40+
fg = (opts.title_invert and C.ui.float) or C.ui.title,
41+
bg = (opts.title_invert and C.ui.title)
42+
or (opts.float and C.ui.prompt)
43+
or (opts.transparent and C.none)
44+
or C.ui.base,
45+
blend = vim.o.winblend or 0,
46+
bold = true,
47+
},
48+
TelescopeResultsTitle = title,
49+
TelescopePreviewTitle = title,
50+
51+
-- TelescopeTitle = { link = "FloatTitle" },
52+
-- TelescopePromptTitle = { link = "TelescopeTitle" },
53+
-- TelescopeResultsTitle = { link = "TelescopeTitle" },
54+
-- TelescopePreviewTitle = { link = "TelescopeTitle" },
1055

1156
----------------
1257
--- Normal
1358
----------------
14-
TelescopeNormal = { link = "NormalPopup" },
15-
TelescopePreviewNormal = { link = "TelescopeNormal" },
16-
TelescopePromptNormal = { link = "TelescopeNormal" },
17-
TelescopeResultsNormal = { link = "TelescopeNormal" },
59+
60+
TelescopePromptNormal = {
61+
fg = C.ui.text,
62+
bg = (opts.border and opts.inactive and C.ui.base)
63+
or (opts.border and opts.float and C.ui.base)
64+
or (opts.inactive and C.ui.prompt)
65+
or (opts.float and C.ui.prompt)
66+
or (opts.transparent and C.none)
67+
or C.ui.base,
68+
blend = vim.o.winblend or 0,
69+
},
70+
TelescopeResultsNormal = normal,
71+
TelescopePreviewNormal = normal,
72+
73+
-- TelescopeNormal = { link = "NormalFloat" },
74+
-- TelescopePromptNormal = { link = "TelescopeNormal" },
75+
-- TelescopeResultsNormal = { link = "TelescopeNormal" },
76+
-- TelescopePreviewNormal = { link = "TelescopeNormal" },
1877

1978
----------------
2079
--- Border
2180
----------------
22-
TelescopeBorder = { link = "PopupBorder" },
23-
TelescopeResultsBorder = { link = "TelescopeBorder" },
24-
TelescopePromptBorder = { link = "TelescopeBorder" },
25-
TelescopePreviewBorder = { link = "TelescopeBorder" },
81+
82+
TelescopePromptBorder = {
83+
fg = (opts.border and C.ui.border) or (opts.inactive and C.ui.base) or (opts.float and C.ui.prompt) or C.ui.base,
84+
bg = (opts.border and opts.inactive and C.ui.base) or (opts.float and C.ui.prompt) or C.ui.prompt,
85+
blend = vim.o.winblend or 0,
86+
},
87+
TelescopeResultsBorder = border,
88+
TelescopePreviewBorder = border,
89+
90+
-- TelescopeBorder = { link = "FloatBorder" },
91+
-- TelescopePromptBorder = { link = "TelescopeBorder" },
92+
-- TelescopeResultsBorder = { link = "TelescopeBorder" },
93+
-- TelescopePreviewBorder = { link = "TelescopeBorder" },
2694

2795
----------------
2896
--- Other
2997
----------------
98+
3099
TelescopePromptPrefix = { fg = C.ui.accent },
31100
TelescopeSelectionCaret = { fg = C.ui.accent },
32-
TelescopeMatching = { fg = C.ui.text_match },
33-
TelescopeSelection = { bg = C.ui.current_line },
34-
-- TelescopeSelection = { fg = C.ui.base, bg = C.ui.accent, bold = true },
101+
TelescopeMatching = { fg = C.ui.text_match, bold = true },
102+
-- TelescopeSelection = { bg = C.ui.current_line },
103+
TelescopeSelection = { link = "PmenuSel" },
35104
TelescopeMultiSelection = { fg = C.syntax.blue },
36105
TelescopeMultiIcon = { fg = C.ui.blue },
37106
}

lua/astrotheme/palettes/astrodark.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ c.ui.text = "#9B9FA9"
5353
c.ui.text_active = "#ADB0BB"
5454
c.ui.text_inactive = "#494D56"
5555
c.ui.text_match = c.ui.accent
56+
c.ui.text_match = "#e0e0ee"
57+
58+
c.ui.prompt = "#202227"
59+
-- c.ui.prompt = "#20242E"
60+
c.ui.results = "#131519"
5661

5762
--------------------------------
5863
--- terminal

lua/astrotheme/palettes/astromars.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ c.ui.none_text = "#393337"
5353
c.ui.text = "#8B7079"
5454
c.ui.text_active = "#A5B2BC"
5555
c.ui.text_inactive = "#68545B"
56-
c.ui.text_match = c.ui.accent
56+
c.ui.text_match = "#ffeeee"
57+
58+
c.ui.prompt = "#281E22"
5759

5860
--------------------------------
5961
--- terminal

0 commit comments

Comments
 (0)