Skip to content

Commit e8b268f

Browse files
committed
feat: add default = true for highlight groups definition.
1. Add `default = true` for highlight groups, allow user to custom style. 2. Add descriptions for highlight groups in doc `rest-nvim.txt`
1 parent 949b585 commit e8b268f

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

doc/rest-nvim.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ rest.nvim ···································
1212
rest.nvim user commands ··································· |rest-nvim.commands|
1313
rest.nvim user events ······································· |rest-nvim.events|
1414
rest.nvim configuration ····································· |rest-nvim.config|
15+
rest.nvim highlight groups ························ |rest-nvim.highlight-groups|
1516

1617
rest.setup({user_configs?}) *rest.setup*
1718
@deprecated use `vim.g.rest_nvim` instead
@@ -247,4 +248,14 @@ rest.Opts.Highlight *rest.Opts.Highlight*
247248
{timeout?} (number) Duration time of the request highlighting in milliseconds (Default: `750`)
248249

249250

251+
==============================================================================
252+
rest.nvim highlight groups *rest-nvim.highlight-groups*
253+
254+
255+
Highlight Group Default Description
256+
-------------------- -------------------------------- --------------------
257+
RestText Comment winbar text
258+
RestPaneTitleNC Statement winbar text in non-current pane
259+
RestPaneTitle Statement + bold + underline winbar Text in current pane
260+
250261
vim:tw=78:ts=8:noet:ft=help:norl:

lua/rest-nvim/ui/result.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,13 @@ local function get_hl_group_fg(name)
233233
return string.format("#%06X", vim.api.nvim_get_hl(0, { name = name, link = false }).fg)
234234
end
235235

236-
vim.api.nvim_set_hl(0, "RestText", { fg = get_hl_group_fg("Comment") })
237-
vim.api.nvim_set_hl(0, "RestPaneTitleNC", { fg = get_hl_group_fg("Statement") })
236+
vim.api.nvim_set_hl(0, "RestText", { fg = get_hl_group_fg("Comment"), default = true })
237+
vim.api.nvim_set_hl(0, "RestPaneTitleNC", { fg = get_hl_group_fg("Statement"), default = true })
238238
vim.api.nvim_set_hl(0, "RestPaneTitle", {
239239
fg = get_hl_group_fg("Statement"),
240240
bold = true,
241241
underline = true,
242+
default = true,
242243
})
243244

244245
---Check if UI window is shown in current tabpage

0 commit comments

Comments
 (0)