shellRaining / hlchunk.nvim

This is the lua implementation of nvim-hlchunk, you can use this neovim plugin to highlight your indent line and the current chunk (context) your cursor stayed
MIT License
449 stars 28 forks source link

i guess we do this already using `chunk`/`indent` but nonetheless... #118

Open daUnknownCoder opened 2 weeks ago

daUnknownCoder commented 2 weeks ago

if we can get this in chunk (one node) / indent (whole file) it will be great: image

so adding fold support will do good: Inspiration: https://github.com/gh-liu/fold_line.nvim

shellRaining commented 2 weeks ago

Feels interesting, but will doing this cause serious performance issues? I'll try out the plugin you mentioned first.

daUnknownCoder commented 2 weeks ago

Feels interesting, but will doing this cause serious performance issues? I'll try out the plugin you mentioned first.

check this: gh-liu/fold_line.nvim#1

shellRaining commented 2 weeks ago

can this display effect meet your need

IMG_20240623_203145_949.jpg

daUnknownCoder commented 2 weeks ago

can this display effect meet your need

wait, thats real cool :lmao: tho the start of line as in return got messed up but we can use the rounded_border glyph for that anyway

can we do this for the current context only tho? coz it may coz perf drops if we do this with the whole file so i guess this is going towards chunk :damn:

tho this almost looks like the plugin

shellRaining commented 2 weeks ago

this is impl by using ibl.hook and statucol.nvim, I have write a demo like below

the first one

image

the second one

image

which one you like better

daUnknownCoder commented 2 weeks ago
  1. the first one (what happened to ur symbols in the second one tho 💀?)
  2. whats the difference?

what ~godly~ font are you using?

Add a little bit of body text Add a little bit of body text (1)

i have just edited the image but is this possible (more similarity to the plugin) tho only when the respective fold is closed

shellRaining commented 2 weeks ago
  1. the first one (what happened to ur symbols in the second one tho 💀?)

the second one use different char and highlight

  1. whats the difference?

the first render in the max level indent line, while the second only render in the first level

what ~godly~ font are you using?

[font]
size = 12

[font.normal]
family = "JetBrainsMono NFM"
style = "Regular"

[font.bold]
family = "JetBrainsMono NFM"
style = "Bold"

[font.italic]
family = "VictorMono NFM"
style = "Italic"

i have just edited the image but is this possible (more similarity to the plugin) tho only when the respective fold is closed

no, hlchunk only set extmark, not monitor fold info... maybe you can search for other plugin

daUnknownCoder commented 2 weeks ago

no, hlchunk only set extmark, not monitor fold info... maybe you can search for other plugin

can we just add another spec for indent like chunk having chars, something like:

chars = {
        vertical_line = "│", -- or `vertical_line` to be passed as a table for multiple indent chars
        left_top = "â•­",
        left_bottom = "â•°",
    },
shellRaining commented 2 weeks ago

no, under the current conditions, it is impossible to achieve the style effect of fold-line. It is necessary to inherit the indent mod and rewrite the render function.

daUnknownCoder commented 2 weeks ago

no, under the current conditions, it is impossible to achieve the style effect of fold-line. It is necessary to inherit the indent mod and rewrite the render function.

no im just asking if we can add indent start and indent end characters

shellRaining commented 2 weeks ago

in the dev brach, you can use filter_list to define your own hook to achieve this, but this field still unstable, maybe change in future...