Commit Graph

578 Commits

Author SHA1 Message Date
hedy
fab3e8ce7c feat(status): Use custom highlight with default links 2023-11-24 16:47:36 +08:00
hedy
896fd2ae63 feat(status): Better information and highlights 2023-11-24 16:31:16 +08:00
hedy
f4d5eb2dad fix(status): Show code window active when no outline opened yet 2023-11-24 16:17:52 +08:00
hedy
b475574fc0 fix(jsx): Label JSX fragment with Fragment kind 2023-11-24 16:11:25 +08:00
hedy
a2410faba9 refactor: Rename module ui -> highlight 2023-11-24 16:10:21 +08:00
hedy
23958f8731 chore(fmt): stylua 2023-11-24 15:04:28 +08:00
hedy
ebf90dc9ee fix(markdown): Don't include next heading in previous heading's range
Somehow marksman also does this?

As for treesitter (norg) it may be because treesitter includes the
newline and the next line indent until the next heading, so the line of
the next heading is included in the range of the previous heading. We
manually -1 on the range end line to fix it.
2023-11-24 15:04:18 +08:00
hedy
2d936bce2d docs: Update readme 2023-11-24 14:52:43 +08:00
hedy
e705330e40 feat: Per-tabpage outlines
Closes #37

Almost completely refactored the UI parts outline.nvim to use a Sidebar
object that implements an outline window. In init.lua, we can then store
a table of the outline for each tabpage ID.

When tabs are closed the outline is closed and sidebar reset
responsibly.

This simplifies `init.lua` quite a lot, making it the highest level
control center for the outline elements.

All lua APIs and commands should work as before.
2023-11-24 14:50:24 +08:00
hedy
83dc477af5 Merge branch 'main' of github.com:hedyhli/outline.nvim 2023-11-23 18:49:35 +08:00
hedy
7187665106 docs: Update changelog 2023-11-23 18:49:12 +08:00
hedyhli
bea285704c Auto generate vim docs 2023-11-23 10:41:23 +00:00
hedy
0c6d97d34a fix(jsx): Show shorthand fragments as "Fragment"
Closes #35

Previously the treesitter javascript parser would treat `<></>`
specially and emit a `jsx_fragment`. We were checking for this type here
(from symbols-outline.nvim), though we did not include `jsx_fragment` in
the parse_ts function to even look for it.

jsx_fragment was recently removed from treesitter parser to reduce
complexity, so we will treat all jsx_element's without a `name` field in
`jsx_opening_element` as the shorthand fragment.

Using "Fragment" as the name in this case makes it look exactly the same
as if the user used `<Fragment></Fragment>` instead.

The check for `jsx_fragment` is still kept in case an older version of
the parser is still used, it can probably be removed next year.

Ref:
- tree-sitter/tree-sitter-javascript#227
2023-11-23 18:39:35 +08:00
hedy
9c54fe1bcf docs: Fix indented list in readme 2023-11-22 22:32:34 +08:00
hedyhli
3d24bc2074 Auto generate vim docs 2023-11-22 14:26:18 +00:00
hedy
ab6587d25f Merge branch 'main' of github.com:hedyhli/outline.nvim 2023-11-22 22:25:47 +08:00
hedy
d35187ef37 feat: Norg provider and support of external providers
- Closes #3
- Ref: simrat39/symbols-outline.nvim#190

Norg contains indents and different types of verbatim tags, I was rather
lazy to read the spec properly and parse norg using regex line-by-line
like markdown, so used treesitter instead. The only requirement is the
`norg` parser for treesitter to be installed. Tested on nvim 0.7.2.

This should lead the way for supporting vimdoc files in a similar
manner.

Documentation for how external providers could look like as of now has
been added.

In the future we could let the provider determine what to do for each
keymap, such as `goto_location` and `toggle_preview`. This would allow
the zk extension[1] to work properly without having to override existing
functions (bad practice).

[1]: https://github.com/mickael-menu/zk-nvim/discussions/134
2023-11-22 22:16:19 +08:00
hedy
8c5c69feb2 chore(fmt): stylua 2023-11-22 21:17:40 +08:00
hedy
ec4f727631 refactor: Reorganize provider API 2023-11-22 20:55:10 +08:00
hedyhli
b1ee9c965e Auto generate vim docs 2023-11-22 12:49:05 +00:00
hedy
3c9f267126 Merge branch 'main' of github.com:hedyhli/outline.nvim 2023-11-22 20:48:39 +08:00
hedy
8551dd01d3 fix(highlights): Only inherit fg for FoldMarker and Guides highlights 2023-11-22 18:10:36 +08:00
hedyhli
1dd17d66c3 Auto generate vim docs 2023-11-21 01:31:17 +00:00
hedy
a335618d5a docs: Clarify about neovim 0.7 in readme 2023-11-21 09:30:49 +08:00
hedy
31ef50e08e Merge branch 'main' of github.com:hedyhli/outline.nvim 2023-11-21 09:24:20 +08:00
~hedy
a21a17cc08 Merge pull request #32 from silvercircle/mine
use neovim core treesitter API instead of nvim-treesitter plugin
2023-11-21 09:24:07 +08:00
hedy
e2838c1e06 feat(preview): Use vim.treesitter API for highlight 2023-11-21 09:18:08 +08:00
hedyhli
44f2a4160c Auto generate vim docs 2023-11-21 00:43:07 +00:00
hedy
a8343026bf docs: Update readme 2023-11-21 08:42:41 +08:00
hedyhli
20e63c01e0 Auto generate vim docs 2023-11-21 00:40:25 +00:00
hedy
699bc85cc5 feat: Properly support nvim-0.7, and fix highlights 2023-11-21 08:39:05 +08:00
Alex
c5ca61177a use neovim core treesitter API instead of nvim-treesitter plugin 2023-11-19 16:07:14 +01:00
hedy
b03c3a4e3d Merge branch 'main' of github.com:hedyhli/outline.nvim 2023-11-19 22:40:53 +08:00
hedy
a239dbfc14 docs: Update readme 2023-11-19 22:40:44 +08:00
hedyhli
138c33f176 Auto generate vim docs 2023-11-19 14:35:42 +00:00
hedy
0cdd8dd915 Merge branch 'main' of github.com:hedyhli/outline.nvim 2023-11-19 22:35:13 +08:00
hedy
ad6b15ee08 refactor: Rename of most recent option 2023-11-19 22:35:07 +08:00
hedyhli
4d02adc7ec Auto generate vim docs 2023-11-19 13:09:21 +00:00
hedy
4bc6bfc0dd docs: Update changelog 2023-11-19 21:08:54 +08:00
hedy
24b4634cee docs: Document new features
Now we should close #28
2023-11-19 21:05:25 +08:00
hedy
3730410237 Merge branch 'main' of github.com:hedyhli/outline.nvim 2023-11-19 19:02:34 +08:00
hedy
3762402dd3 refactor(providers): Let get_status() return a list of strings instead 2023-11-19 19:02:00 +08:00
hedy
9b90379c7a Refactor 2023-11-19 17:45:41 +08:00
hedy
fa219c33af feat: More auto-unfold options
Option to auto unfold when there is only N root nodes in outline.

Defaults to 1, meaning if there is only one 'root' parent, it should
always be unfolded.

This is useful if the entire file is a single function or a single
'return'.

The old auto_unfold_hover option **still works as expected**.
2023-11-19 17:43:15 +08:00
hedy
3b27272319 feat(Status): Better provider info and show filter info 2023-11-19 16:59:49 +08:00
hedyhli
929d8eba34 Auto generate vim docs 2023-11-19 00:42:10 +00:00
hedy
4834db0802 docs: Only show 2nd level headings in TOC 2023-11-19 08:41:42 +08:00
hedyhli
c6f9f4573c Auto generate vim docs 2023-11-18 14:32:16 +00:00
hedy
036bae6834 docs: More consistency in referring to config options 2023-11-18 22:31:33 +08:00
hedyhli
21b0541f2f Auto generate vim docs 2023-11-18 14:25:35 +00:00