mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
docs: docgen
This commit is contained in:
parent
1de6c15288
commit
1d001a70c2
25 changed files with 327 additions and 74 deletions
68
docs/scroll.md
Normal file
68
docs/scroll.md
Normal file
|
@ -0,0 +1,68 @@
|
|||
# 🍿 scroll
|
||||
|
||||
<!-- docgen -->
|
||||
|
||||
## 📦 Setup
|
||||
|
||||
```lua
|
||||
-- lazy.nvim
|
||||
{
|
||||
"folke/snacks.nvim",
|
||||
opts = {
|
||||
scroll = {
|
||||
-- your scroll configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## ⚙️ Config
|
||||
|
||||
```lua
|
||||
---@class snacks.scroll.Config
|
||||
---@field animate snacks.animate.Config
|
||||
{
|
||||
animate = {
|
||||
duration = { step = 15, total = 250 },
|
||||
easing = "linear",
|
||||
},
|
||||
-- what buffers to animate
|
||||
filter = function(buf)
|
||||
return vim.g.snacks_scroll ~= false and vim.b[buf].snacks_scroll ~= false
|
||||
end,
|
||||
}
|
||||
```
|
||||
|
||||
## 📚 Types
|
||||
|
||||
```lua
|
||||
---@alias snacks.scroll.View {topline:number, lnum:number}
|
||||
```
|
||||
|
||||
```lua
|
||||
---@class snacks.scroll.State
|
||||
---@field win number
|
||||
---@field buf number
|
||||
---@field view snacks.scroll.View
|
||||
---@field current snacks.scroll.View
|
||||
---@field target snacks.scroll.View
|
||||
---@field scrolloff number
|
||||
---@field mousescroll number
|
||||
---@field height number
|
||||
```
|
||||
|
||||
## 📦 Module
|
||||
|
||||
### `Snacks.scroll.disable()`
|
||||
|
||||
```lua
|
||||
Snacks.scroll.disable()
|
||||
```
|
||||
|
||||
### `Snacks.scroll.enable()`
|
||||
|
||||
```lua
|
||||
Snacks.scroll.enable()
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue