Skip to content

Commit

Permalink
fix(ts-context): always call setup on start (ayamir#828) (ayamir#830)
Browse files Browse the repository at this point in the history
* fix(nvim-treesitter-context): setup to enable (ayamir#828)

Change-Id: I7942ac85bf3791f7487eb15fae9cb6c0aa3c6b71

* fixup! fix(nvim-treesitter-context): setup to enable (ayamir#828)

* fixup! fixup! fix(nvim-treesitter-context): setup to enable (ayamir#828)

---------

Co-authored-by: Jint-lzxy <[email protected]>
  • Loading branch information
2 people authored and singlemancombat committed Jun 30, 2023
1 parent 5c6f073 commit 5906952
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
12 changes: 12 additions & 0 deletions lua/modules/configs/editor/ts-context.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
return function()
require("treesitter-context").setup({
enable = true,
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
line_numbers = true,
multiline_threshold = 20, -- Maximum number of lines to collapse for a single context line
trim_scope = "outer", -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
mode = "cursor", -- Line used to calculate context. Choices: 'cursor', 'topline'
zindex = 30,
})
end
5 changes: 4 additions & 1 deletion lua/modules/plugins/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,14 @@ editor["nvim-treesitter/nvim-treesitter"] = {
config = require("editor.treesitter"),
dependencies = {
{ "nvim-treesitter/nvim-treesitter-textobjects" },
{ "nvim-treesitter/nvim-treesitter-context" },
{ "mrjones2014/nvim-ts-rainbow" },
{ "JoosepAlviste/nvim-ts-context-commentstring" },
{ "mfussenegger/nvim-treehopper" },
{ "andymass/vim-matchup" },
{
"nvim-treesitter/nvim-treesitter-context",
config = require("editor.ts-context"),
},
{
"windwp/nvim-ts-autotag",
config = require("editor.autotag"),
Expand Down

0 comments on commit 5906952

Please sign in to comment.