Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ts-context): always call setup on start (#828) #830

Merged
merged 3 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion lua/modules/plugins/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ 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") },
Jint-lzxy marked this conversation as resolved.
Show resolved Hide resolved
{
"windwp/nvim-ts-autotag",
config = require("editor.autotag"),
Expand Down