10 Commits

Author SHA1 Message Date
27Onion Nebell
e93286a489 fix: add version check for nvim_set_option_value and nvim_get_option_value 2025-04-18 16:33:09 +08:00
27Onion Nebell
7d2387dc12 chore(fmt): format using stylua
Also fixed something in .stylua.toml that may cause stylua to fail, by
the way
2025-04-14 22:39:13 +08:00
27Onion Nebell
1460136dd0 fix: adjust more to make it backward compatible for 0.11- 2025-04-12 12:26:40 +08:00
hedy
9f69f12161 refactor: Reorganize modules
Primarily:
- Utils
- Sidebar (removed the need of writer.lua)
- Resolve keymaps shortcut in config eraly
- Put highlight functions into highlight.lua
- Put functions that do stuff on outline window into view.lua
2023-11-26 13:17:18 +08:00
hedy
3b27272319 feat(Status): Better provider info and show filter info 2023-11-19 16:59:49 +08:00
hedy
d35ee70f95 feat: Better highlight-hover/follow-cursor procedures
Previously on each outline open, the `writer.make_outline` function
might be called at least 4 times(!), after this refactor it will only be
called once. And on update cursor autocmds, also called once (previously
at least twice).

behaviour:
- Now the outline window focus and highlight can update on each cursor
  move (previously CursorHold, dependent on updatetime). This is now
  configurable as well.

- During fold-all/unfold-all operations, now the cursor will remain on
  the same node (rather than same line in outline buffer).

- The performance improvement is not significantly observable since even
  the old implementation can appear instant. One may even argue I am
  fixing a problem that did not exist, but implementation-wise it's just
  so much better now.

config:
- outline_window.auto_update_events, list of events to be passed to
  create_user_autocmd for updating cursor focus in outline, and updating
  outline items (refetching symbols), using keys cursor and items
  respectively.

- outline_window.show_cursorline now supports 2 other string values:
  'focus_in_outline'/'focus_in_code' which controls when to enable
  cursorline. Setting to true retains the default behaviour of always
  showing the cursorline. This was added because now that the cursor
  focus on the outline could change on each CursorMoved, the cursorline
  may pose to be qute attention-seeking during the outline cursor
  updates. Hence `focus_in_outline` is added so that when focus is in
  code, the cursorline for outline window is not shown.

  'focus_in_code' is added so that a user who disabled
  highlight_hovered_item can keep track of position in outline when
  focus is in code, disabling cursorline when focus is in outline.

  At any given time, if hide cursor is enabled and show_cursorline is a
  string value, hiding of cursor will not be done if cursorline is not
  shown in the the given situation.

implementation:
- The reason for the improvement in performance as described in the
  first paragraph is due to merging of finding hover item and finding
  the deepest matched node to put cursor, into writer.make_outline. This
  done, when previously done in separate function, because after the
  separate function (namely _highlight_hovered_item) finishes,
  writer.make_outline is called *again* anyway.

- Autocmds to update cursor position in outline is now done per buffer
  rather than global.

Somehow the auto unfold and unfold depth options still work perfectly,
for this we should thank simrat or which ever contributor that
modularized the folding module and made it adaptable :)
2023-11-18 09:34:16 +08:00
hedy
dc55a8b942 chore(fmt): Finally let's use stylua
Hoping it's as good as go-fmt
2023-11-17 09:28:33 +08:00
hedy
134b7e2f39 feat: Jump highlight customizations
Closes #27

- Highlight group 'OutlineJumpHighlight' (links to Visual by default)
- Config: outline_window.jump_highlight_duration (integer for
  milliseconds, or boolean to enable/disable)
2023-11-16 22:14:47 +08:00
hedy
4d871ec64b refactor: Better messages 2023-11-16 14:28:29 +08:00
hedy
965a3842c8 MAJOR: Project rename and preparation for v1.0.0
I hope I haven't missed any for the renames!
2023-11-12 12:40:32 +08:00