mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 02:38:46 +00:00
fix(scope): properly caluclate start indent when cursor=true
for indent scopes. See #5068
This commit is contained in:
parent
7281912e92
commit
e63fa7bf05
1 changed files with 3 additions and 1 deletions
|
@ -281,7 +281,9 @@ function IndentScope:find(opts)
|
|||
end
|
||||
|
||||
if opts.cursor then
|
||||
indent = math.min(indent, opts.pos[2] + 1)
|
||||
local before = vim.fn.getline(opts.pos[1]):sub(1, opts.pos[2])
|
||||
before = before:gsub("\t", (" "):rep(vim.bo[opts.buf].tabstop or 2))
|
||||
indent = math.min(indent, vim.api.nvim_strwidth(before) + 1)
|
||||
end
|
||||
|
||||
-- expand to include bigger indents
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue