ayamir / nvimdots

A well configured and structured Neovim.
BSD 3-Clause "New" or "Revised" License
2.82k stars 451 forks source link

fix: utilize `ts-context` in `glance` preview window #1265

Closed mjkx5 closed 4 weeks ago

mjkx5 commented 1 month ago

default zindex of glance [dnlhc/glance.nvim] floatterm is 45. It can display on glance.

CharlesChiuGit commented 1 month ago

how to trigger the error?

mjkx5 commented 1 month ago

zindex nvim-treesitter/nvim-treesitter-context : default 20 dnlhc/glance.nvim: default 45, vim.api.nvim_open_win({zindex: })

zindex: Stacking order. floats with higher zindex go on top on floats with lower indices. Must be larger than zero.

CharlesChiuGit commented 1 month ago

I'm not asking why, I'm asking how.

I don't see the point of setting ts-context's zindex to a higher value. Glance should be on top of other things since it's a more temporary thing other than ts-context.

Please explain your reasons of this PR.

mjkx5 commented 1 month ago

eeeeeeeeeeeeeeee

It is result of that config.

Screenshot_24-May_16-57-17_18805

if not that config, function SetNodeConfig() isn't display.

mjkx5 commented 1 month ago

for example, I press gh, open the preview popup window. If not that config, I need <c-w>h into preview, then [[ jump to position of function name. when look at function name, I realize if that is position that I want to jump to. if not, I neet to jump items list , to repeat next. If true, I need to return that position.

use that config, I don't need to jump function name.

In fact, that is still not the best, I need to jump left preview window to display function name. If cursor is right window, It display the function name, which is the best, but I don't have time to do that these two days.

mjkx5 commented 1 month ago

for example, I look at mod test In preview window, I can realize that It isn't that I want. Screenshot_25-May_09-14-15_14005

mjkx5 commented 1 month ago

In my case, trim_scope set inner better than outer. Have someone using inner?

CharlesChiuGit commented 1 month ago

for example, I look at mod test In preview window, I can realize that It isn't that I want.

aha, that make sense to me now. tks for the clarification!

CharlesChiuGit commented 1 month ago

In my case, trim_scope set inner better than outer. Have someone using inner?

never tried it, i didn't notice major difference in my use case. but i think it's fine to change it.

mjkx5 commented 1 month ago

@CharlesChiuGit I am not familiar with pull request. I accidentally used push --force, that delete your commit.

Please repeat commit, thanks.

mjkx5 commented 1 month ago

max_lines is set to 3. that means that It can display three lines in window header.

eg: if display text is 4 lines.

mod modName{ func functionName{ switch { A : B: } } }

In that case, set inner discard case A B. set outer discard modname.

as comment, Which context lines to discard if max_lines is exceeded.

In my nvimdot, I use inner.