Skip to content

Commit

Permalink
feat: support nvim-treesitter-context
Browse files Browse the repository at this point in the history
  • Loading branch information
Iron-E committed Feb 5, 2024
1 parent cf33eaa commit 3ef260f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ require('highlite').setup {
<li><a href="https://github.com/folke/todo-comments.nvim">
todo_comments
</a></li>
<li><a href="https://github.com/nvim-treesitter/nvim-treesitter-context">
treesitter_context
</a></li>
<li><a href="https://github.com/folke/trouble.nvim">
trouble
</a></li>
Expand Down
3 changes: 3 additions & 0 deletions doc/highlite.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ neotest
<li><a href="https://github.com/folke/todo-comments.nvim">
todo_comments
</a></li>
<li><a href="https://github.com/nvim-treesitter/nvim-treesitter-context">
treesitter_context
</a></li>
<li><a href="https://github.com/folke/trouble.nvim">
trouble
</a></li>
Expand Down
5 changes: 4 additions & 1 deletion lua/highlite/groups/default.lua
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,10 @@ local function from_palette(palette, opts)
groups.TodoSignWARN = 'TodoFgWARN'
end

if all_syntax or nvim_plugins.treesitter_context ~= false then
groups.TreesitterContextLineNumber = Groups.extend({fg = sign_column.fg}, groups'NormalFloat')
end

if all_nvim_plugins or nvim_plugins.trouble ~= false then
groups.TroubleCount = {fg = palette.number, sp = palette.text_contrast_bg_high, underline = true}
end
Expand Down Expand Up @@ -846,7 +850,6 @@ local function from_palette(palette, opts)
groups.cppSTLexception = '@keyword.exception.cpp'
groups.cppSTLnamespace = '@module.cpp'
end

if all_syntax or syntax.cs ~= false then
groups.csAccessModifier = '@keyword.cs'
groups.csAccessor = 'csLogicSymbols'
Expand Down
2 changes: 1 addition & 1 deletion lua/highlite/groups/types.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- @meta

--- @alias highlite.groups.from_palette.opts.plugins.nvim 'aerial'|'barbar'|'cmp'|'fzf'|'gitsigns'|'indent_blankline'|'lazy'|'leap'|'lsp_signature'|'lspconfig'|'lspsaga'|'mini'|'neotest'|'nvim_tree'|'packer'|'sniprun'|'symbols_outline'|'telescope'|'todo_comments'|'trouble'
--- @alias highlite.groups.from_palette.opts.plugins.nvim 'aerial'|'barbar'|'cmp'|'fzf'|'gitsigns'|'indent_blankline'|'lazy'|'leap'|'lsp_signature'|'lspconfig'|'lspsaga'|'mini'|'neotest'|'nvim_tree'|'packer'|'sniprun'|'symbols_outline'|'telescope'|'todo_comments'|'treesitter_context'|'trouble'
--- @alias highlite.groups.from_palette.opts.plugins.vim 'ale'|'coc'|'easymotion'|'fern'|'gitgutter'|'indent_guides'|'jumpmotion'|'nerdtree'|'sandwich'|'signify'|'swap'|'undotree'

--- @alias highlite.groups.from_palette.opts.syntax 'coq'|'cpp'|'cs'|'css'|'dart'|'dosini'|'dot'|'git'|'go'|'help'|'html'|'i3config'|'java'|'javascript'|'json'|'lua'|'make'|'man'|'markdown'|'python'|'razor'|'ruby'|'rust'|'scala'|'scss'|'sh'|'solidity'|'sql'|'tex'|'toml'|'vim'|'xdefaults'|'xml'|'xxd'|'yaml'
Expand Down

0 comments on commit 3ef260f

Please sign in to comment.