kevinhwang91 / nvim-ufo

Not UFO in the sky, but an ultra fold in Neovim.
BSD 3-Clause "New" or "Revised" License
2.23k stars 44 forks source link

decide preview position by fold kind #73

Closed hleft closed 1 year ago

hleft commented 1 year ago

Feature description

peekFoldedLinesUnderCursor will open preview window after cursor , so I can see function comment and function content ,

but if use CocAction('fold', 'comment'), then preview comment will overlap with function, can't see comment and function at the same time

Describe the solution you'd like

support if fold comment, preview before cursor, instead always preview after cursor

Additional context

No response

kevinhwang91 commented 1 year ago

Yes, I also need this feature.

kevinhwang91 commented 1 year ago

Do you have any suggestions to handle the bottom border for this feature?

Edit: Look like need to refactor the signature of peekFoldedLinesUnderCursor.

hleft commented 1 year ago

@kevinhwang91 I don't know the relationship between this feature and the bottom border...

kevinhwang91 commented 1 year ago

Never mind, it will work perfectly when the feature is done.

kevinhwang91 commented 1 year ago

Done. It's hard coding for now because I can't come up with other use cases.

hleft commented 1 year ago

Done. It's hard coding for now because I can't come up with other use cases.

How to config it work? I update then use CocAction('fold', 'comment') and preview still after cursor

kevinhwang91 commented 1 year ago

Make sure UfoInspect output Selected provider: lsp and peek folded comment lines.

hleft commented 1 year ago

@kevinhwang91 thanks, worked ok. I forget need change to lsp

kevinhwang91 commented 1 year ago

The trace action is broken for this, I'm working on it.

hleft commented 1 year ago

@kevinhwang91 Now preview comment will not overlap, but preview function content will overlap one line comment

kevinhwang91 commented 1 year ago

I can't get your point, please explain clearly. Maybe a screenshot or a video should help.

hleft commented 1 year ago

@kevinhwang91

1

preview comment, not overlap function content 2

preview function content, overlap one line comment 3

hope preview content not overlap comment

kevinhwang91 commented 1 year ago

It's expected, depending on your border.

hleft commented 1 year ago

@kevinhwang91 Well, some want to have borders and not overlapping ...

kevinhwang91 commented 1 year ago

Normal folded lines need to reduce redraw if fire trace action. I don't think it will often fire the trace action under the folded lines with comment kind.