fix(extras.treesitter-context): change event back to LazyFile (#4940)

## Description

Load treesitter-context on `LazyFile` instead of `VeryLazy`. IMHO it
didn't make sense to load the plugin earlier just so that the toggle is
available, especially when the toggle won't actually have any effect
anything until a file is opened.

~Previously, treesitter-context was loaded on `VeryLazy` and its toggle
map in `opt`, which also `require`d it. Now, mapping happens in config,
after treesitter-context is setup (also how toggle is handled in other
extras, eg for render-markdown).~

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
This commit is contained in:
Stefan Boca
2024-12-05 00:11:40 -08:00
committed by GitHub
parent 12e37529e7
commit 83017ff28a

View File

@ -1,7 +1,7 @@
-- Show context of the current function
return {
"nvim-treesitter/nvim-treesitter-context",
event = "VeryLazy",
event = "LazyFile",
opts = function()
local tsc = require("treesitter-context")
Snacks.toggle({