mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 10:49:08 +00:00
fix(indent): expand scopes to inlude end_pos based on the end_pos scope. See #231
This commit is contained in:
parent
7ea0035ba6
commit
897f801924
1 changed files with 8 additions and 2 deletions
|
@ -385,8 +385,14 @@ function M.get(opts)
|
|||
ret = Class:find(opts)
|
||||
end
|
||||
|
||||
if ret and opts.end_pos then
|
||||
ret = ret:expand(opts.end_pos[1]) or ret
|
||||
if ret and opts.end_pos and false then
|
||||
local end_scope = M.get(vim.tbl_extend("keep", { pos = opts.end_pos, end_pos = false }, opts))
|
||||
if end_scope and end_scope.from < ret.from then
|
||||
ret = ret:expand(end_scope.from) or ret
|
||||
end
|
||||
if end_scope and end_scope.to > ret.to then
|
||||
ret = ret:expand(end_scope.to) or ret
|
||||
end
|
||||
end
|
||||
|
||||
local min_size = opts.min_size or 2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue