Commit graph

38 commits

Author SHA1 Message Date
Folke Lemaitre
4c52b7f25d
fix(scroll): compat with Neovim 0.9.4 2025-02-24 10:34:25 +01:00
Folke Lemaitre
7161dc1b57
fix(scroll): added keepjumps 2025-02-13 21:03:33 +01:00
Folke Lemaitre
a3194d9519
perf(scroll): much better/easier/faster method for vertical cursor positioning 2025-02-13 20:54:49 +01:00
Folke Lemaitre
e71955a941
feat(scroll): big rework to make scroll play nice with virtual lines 2025-02-13 11:37:44 +01:00
Folke Lemaitre
73d2f0f40c
feat(scroll): scroll improvements. Closes #1024 2025-02-09 15:43:13 +01:00
Folke Lemaitre
3da0b0ec11
fix(scroll): handle buffer changes while animating 2025-01-23 20:46:29 +01:00
Folke Lemaitre
559d6c6bf2
feat(snacks): added snacks.picker (#445)
## Description

More info coming tomorrow.

In short:
- very fast. pretty much realtime filtering/sorting in huge repos (like
1.7 million files)
- extensible
- easy to customize the layout (and lots of presets) with
`snacks.layout`
- simple to create custom pickers
- `vim.ui.select`
- lots of builtin pickers
- uses treesitter highlighting wherever it makes sense
- fast lua fuzzy matcher which supports the [fzf
syntax](https://junegunn.github.io/fzf/search-syntax/) and additionally
supports field filters, like `file:lua$ 'function`

There's no snacks picker command, just use lua.

```lua
-- all pickers
Snacks.picker()

-- run files picker
Snacks.picker.files(opts)
Snacks.picker.pick("files", opts)
Snacks.picker.pick({source = "files", ...})
```

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Todo
- [x] issue with preview loc not always correct when scrolling fast in
list (probably due to `snacks.scroll`)
- [x] `grep` (`live_grep`) is sometimes too fast in large repos and can
impact ui rendering. Not very noticeable, but something I want to look
at.
- [x] docs
- [x] treesitter highlights are broken. Messed something up somewhere

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->
2025-01-14 22:53:59 +01:00
Folke Lemaitre
d494a9e664
feat(scroll): faster animations for scroll repeats after delay. (replaces spamming handling) 2025-01-11 12:07:15 +01:00
Folke Lemaitre
ac8b3cdfa0
fix(scroll): don't animate for new changedtick. Fixes #384 2025-01-06 16:55:18 +01:00
Folke Lemaitre
7dcdcb0b6a
fix(scroll): don't animate when recording or executing macros 2025-01-06 16:54:37 +01:00
Folke Lemaitre
fc0a99b849
fix(scroll): don't animate when leaving cmdline search with incsearch enabled. Fixes #331 2024-12-18 07:09:03 +01:00
Folke Lemaitre
b6032e8f1b
fix(scroll): check for invalid window. Fixes #340 2024-12-18 06:49:07 +01:00
Folke Lemaitre
3d67bda1e2
fix(scroll): check mousescroll before spamming 2024-12-15 08:36:14 +01:00
Folke Lemaitre
002d5eb5c2
feat(util): on_key handler 2024-12-15 08:26:44 +01:00
Folke Lemaitre
5532ba07be
feat(scroll): improve smooth scrolling when user is spamming keys 2024-12-13 09:52:58 +01:00
Folke Lemaitre
c58605f8b3
feat(scroll): added spamming detection and disable animations when user is spamming keys :) 2024-12-12 18:13:19 +01:00
Folke Lemaitre
a986851a74
fix(scroll): don't animate scroll distance 1 2024-12-12 18:13:19 +01:00
Folke Lemaitre
50912dc2fd
feat(animate): allow toggling buffer-local / global animations with or without id 2024-12-12 09:18:54 +01:00
Folke Lemaitre
25c290d7c0
feat(animate): allow disabling all animations globally or per buffer 2024-12-12 08:44:19 +01:00
Folke Lemaitre
33fbb309f8
fix(compat): fixes for Neovim < 0.10 2024-12-11 23:20:28 +01:00
Folke Lemaitre
41ca13d119
fix(scroll): don't animate invalid windows 2024-12-11 20:50:44 +01:00
Folke Lemaitre
7b5a78a5c7
fix(scroll): disable scroll by default for terminals 2024-12-11 10:35:15 +01:00
Folke Lemaitre
280a09e4ee
fix(scroll): use actual scrolling to perform the scroll to properly deal with folds etc. Fixes #236 2024-12-11 09:54:39 +01:00
Folke Lemaitre
fefa6fd692
feat(scroll): user virtual columns while scrolling 2024-12-11 09:54:06 +01:00
Folke Lemaitre
0ca9ca7992
fix(scroll): don't bother setting cursor when scrolloff is larger than half of viewport. Fixes #240 2024-12-11 09:53:00 +01:00
Folke Lemaitre
26c3e4960f
feat(scroll): use on_key to track mouse scrolling 2024-12-11 09:51:00 +01:00
Folke Lemaitre
7211ec08ce
fix(scroll): move scrollbind check to M.check 2024-12-10 21:32:26 +01:00
Folke Lemaitre
c9880ce872
fix(scroll): only animate the current window when scrollbind is active 2024-12-10 20:34:06 +01:00
Folke Lemaitre
4209929e6d
fix(scroll): set cursor to correct position when target is reached. Fixes #236 2024-12-10 19:36:58 +01:00
Folke Lemaitre
140204fde5 build: added metadata to plugins 2024-12-10 13:55:51 +01:00
Folke Lemaitre
1d001a70c2 docs: docgen 2024-12-10 13:55:51 +01:00
Folke Lemaitre
aa5d00936d refactor(animate): class / docs / cleanup 2024-12-10 13:55:51 +01:00
Folke Lemaitre
46bab2d8e8 refactor(scroll): docs and cleanup 2024-12-10 13:55:51 +01:00
Folke Lemaitre
2f1c2cfb91 refactor: remove redundant setup functions 2024-12-10 13:55:51 +01:00
Folke Lemaitre
3dcaad8d0a fix(scroll): better toggle 2024-12-10 13:55:51 +01:00
Folke Lemaitre
14dcb0e6cf refactor(scroll): ignore mouse events, handle scrolloff and better way to detect animation scroll events 2024-12-10 13:55:51 +01:00
Folke Lemaitre
04f15c1ba2 feat(scroll): allow disabling scroll globally or for some buffers 2024-12-10 13:55:51 +01:00
Folke Lemaitre
38a5ccc3a6 feat(scroll): added smooth scrolling plugin 2024-12-10 13:55:51 +01:00