Commit Graph

719 Commits

Author SHA1 Message Date
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
hedy
f8c212bcd2 docs: Document new options, commands, API functions 2023-11-18 22:24:34 +08:00
hedy
c06039da1e feat: Add refresh_outline function 2023-11-18 22:09:19 +08:00
hedy
6ea44bff68 fix(show_help): Indicate when keymap is disabled 2023-11-18 22:08:52 +08:00
hedy
f83eb09635 docs: Update readme 2023-11-18 21:19:47 +08:00
hedy
fa1a999f80 docs: Update changelog 2023-11-18 21:13:11 +08:00
hedy
87a72f88fa fix: Delete autocmds when wiping state 2023-11-18 21:08:13 +08:00
hedy
e56145f8dd feat: Proper floating window for keymap help and OutlineStatus
No more obnoxious '}' on the cmdline when pressing `?`!

scope:
- More type hints
- Added class Float for creating floating windows with size that fit the
  content and position centered on the screen
- show_help action for outline window (key `?`) now uses a floating
  window
- :OutlineStatus now provides better information, and shows content in a
  floating window.

future:
- Floating window option configuration
2023-11-18 20:52:50 +08:00
hedy
6af621f168 docs: Update changelog 2023-11-18 15:10:14 +08:00
hedy
090da7633b fix: Preview window position based on outline split position
- preview window can adapt based on position of outline window, and not
  based on config value of `position` left/right
- it can also properly vertically center-align, even when there are
  horizontal splits below the outline
- fixed a few bugs associated with previous rewrite commits in init.lua

config:
- Added min_height for preview window
2023-11-18 15:04:26 +08:00