Open oskarrrrrrr opened 1 month ago
Thanks for this! I'll take a look at it soon.
I've encountered on issue, not sure if my change caused it. When there is a window with help file open and another with, for example, a lua file then the outline sidebar will show outline for the lua file always. For some reason the outline for help files seems to work only for one file and if there is another buffer in the same tab it will take over. Even switching between two help files won't work, the first one will be always shown in the sidebar. Other filetypes seem to work fine. I can try to debug that, but maybe someone has an idea what could be the reason?
Currently outline looks for buflisted
option to determine whether the symbols should be refreshed when we switch to a new buffer.
This check is only done on "refresh", ie, when the cursor moves or text changed (governed by outline_items.auto_update_events.items
), which means it prevents the outline items from updating when the user navigates from the code to things like floating windows (eg, :LspStatus
).
I believe it makes sense to special case the help
ft here (for instance, only ignore refresh if buflisted
is false and ft
is not help
), now that vimdocs are now supported in outline.nvim.
Thanks, changing this one line fixed the issue.
I got rid of "OutlineHelp" from the condition, because outline help buffer is created with 'buflisted' set to false.
Thanks for your thorough testing -- I didn't encounter these issues during mine. What are some help pages you used that can reproduce this issue?
These are not big issues to be honest and maybe not as common as I initially thought, here are some examples.
Heading with no text (except for the tag):
Three tags in the same line:
Two tags referring to the same thing in multiple lines:
Modeline is a header:
(you can see the help file name in the top left corner)
The examples with tags are not necessarily issues with the help file formatting. It's just that they take a lot of lines in the sidebar. Not a big deal probably.
Here is an example where some tags for a heading are in the line before that heading:
I've added Vimdoc support, the implementation is very similar to that of Norg's. I included headings and tags in the outline, just headings provide very little information.
There seem to be quite a lot of edge cases that could be improved. For example, sometimes there are empty headings or headings that are not actual document headings but table headings. Sometimes there are multiple tags in one line, sometimes in multiple lines (but they refer to the same thing). The formatting seems quite inconsistent, even in the builtin documentation (e.g. the main page marks modeline as heading, other pages seem to get it right...). We could come up with some heuristics for the most common cases, for now I ignored all that.
Example below.
I used
Variable
kind for tags so that they can be easily filtered out.I've encountered on issue, not sure if my change caused it. When there is a window with help file open and another with, for example, a lua file then the outline sidebar will show outline for the lua file always. For some reason the outline for help files seems to work only for one file and if there is another buffer in the same tab it will take over. Even switching between two help files won't work, the first one will be always shown in the sidebar. Other filetypes seem to work fine. I can try to debug that, but maybe someone has an idea what could be the reason?
Resolves: #34