luckasRanarison / nvim-devdocs

Neovim DevDocs integration
MIT License
269 stars 19 forks source link

lua-5.4 docs are all one giant document #8

Closed semanticart closed 1 year ago

semanticart commented 1 year ago

I Installed lua-5.4 docs and while the search terms populate correctly, selecting a term just sends you to the top of the 4k-line document.

It also renders the entire document in the preview field as you type which can be a little laggy.

I'm on the latest (at time of writing):

https://github.com/luckasRanarison/nvim-devdocs/assets/8633/ea838a7d-9454-4820-998e-067df5c7d10e

LMK if I can provide more details. I love this plugin.

luckasRanarison commented 1 year ago

Thanks for giving my plugin a try :). It is actually a known issue #1, I'm still making experiments with vim.fn.search(), please keep waiting a little bit, I'll try to fix this asap.

luckasRanarison commented 1 year ago

I'm also thinking about using asynchronous functions to avoid blocking.

semanticart commented 1 year ago

Thanks, and sorry for missing the existing issue.

luckasRanarison commented 1 year ago

It's fine. Concerning the lua docs and all the documentations in general I think it would be hard to always move directly to the section being searched. Here is a sample of the entries for the lua docs:

2023-08-12-095154_hyprshot

The path refers to the HTML class and id in the original HTML documentation but these are omitted when converting the HTML to markdown. The best we can do is to get the first part of the path which refers to the actual documentation entry. In the case of the lua docs, there's only one entry: index.

2023-08-12-095117_hyprshot

We could still use vim.fn.search() and make some assertions but it won't get it right every time.

luckasRanarison commented 1 year ago

Update: It's actually possible! And I'll track this issue in #17

semanticart commented 1 year ago

Awesome, thanks!

luckasRanarison commented 1 year ago

With #21, jumping works for normal files now. But for the moment it doesn't work in the picker previewer and when rendering with custom cmd.

benelan commented 1 year ago

Would it be possible to split the single file doc sources into multiple files during transpilation based on the headers, or whatever you're using to populate telescope entries?

Jumping works great now but it still takes a long time to render via glow and the telescope previewer needs to rerender when changing entries even though the content doesn't change.

Thanks for making this by the way!

luckasRanarison commented 1 year ago

That's what I'm going to do, thanks for your interest in the project.

luckasRanarison commented 1 year ago

Closing this as completed, see #42