-
-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add default = true for highlight groups definition. (#541)
* 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` * fix: move highlight documents to luaCAT comments --------- Co-authored-by: Seongmin Lee <[email protected]>
- Loading branch information
1 parent
7ca9204
commit 54ee52a
Showing
5 changed files
with
51 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
---@mod rest-nvim.highlight-groups rest.nvim highlight groups | ||
--- | ||
---@brief [[ | ||
--- | ||
--- rest.nvim result UI implementation | ||
--- Highlight Group Default Description | ||
--- -------------------- -------------------------------- -------------------- | ||
--- RestText Comment winbar text | ||
--- RestPaneTitleNC Statement winbar text in non-current pane | ||
--- RestPaneTitle Statement + bold + underline winbar Text in current pane | ||
--- | ||
---@brief ]] | ||
|
||
---Get the foreground value of a highlighting group | ||
---@param name string Highlighting group name | ||
---@return string | ||
local function get_hl_group_fg(name) | ||
-- This will still error out if the highlight doesn't exist | ||
return string.format("#%06X", vim.api.nvim_get_hl(0, { name = name, link = false }).fg) | ||
end | ||
|
||
vim.api.nvim_set_hl(0, "RestText", { fg = get_hl_group_fg("Comment"), default = true }) | ||
vim.api.nvim_set_hl(0, "RestPaneTitleNC", { fg = get_hl_group_fg("Statement"), default = true }) | ||
vim.api.nvim_set_hl(0, "RestPaneTitle", { | ||
fg = get_hl_group_fg("Statement"), | ||
bold = true, | ||
underline = true, | ||
default = true, | ||
}) | ||
|
||
---@comment HACK: to generate documnet with vimcats | ||
local M = {} | ||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters