otavioschwanck / arrow.nvim

Bookmark your files, separated by project, and quickly navigate through them.
Other
341 stars 16 forks source link

treesitter-context integration #43

Closed xzbdmw closed 3 months ago

xzbdmw commented 3 months ago

It looks like with line_shift_down=2

截屏2024-04-11 03 49 41

with line_shift_down=1

截屏2024-04-11 03 50 43

with line_shift_down=0

截屏2024-04-11 03 50 59

the config option now is

        per_buffer_config = {
            treesitter_context = {
                line_shift_down = 2, -- how many lines shift down from center, so cursor above will have actual code not influenced by context.
            },
            lines = 6,
        },

note: the zindex should be lower than context's window Please try this branch to test it, we can make this option undocumented, test it for now and wait this to merge( I tried to make it work out of box, but our window opens too fast to determine bufnr in WinEnter autocmd). https://github.com/nvim-treesitter/nvim-treesitter-context/pull/419