weird MoveBlock selection when moved through a foldable region
I've recorded it here, It only happens when moving the block downwards.
This was tested with more than one fold setting so I wouldn't say the issue lies there
I should point that I've faced the same issue with my hacky block-moving keybind, in fact my hope was using a more maintained solution like this plugin would fix it.
here's the same text block for testing purposes
--- defines div and mul
-- @module side
--- multiplies two numbers.
function mul(p1, p2)
return p1 * p2
end
--- divides two numbers.
function div(p1, p2)
return p1 / p2
end
-- entities: This <foo>, quot: ", ampersand: &
-- escaped markdown: __foo\_bar__
-- **bold** *italic*
local foo = 123
-- escaped markdown: `foo\_bar`
local bar = 123
local a = {}
local ASD = 123
local ASD = 123
It seems that when entering in a foldable section, the references of which lines to move is mixed up with the ones on the fold. Will check it out, thanks!
Best case scenario is:
- this gets fixed
- moved text jumps over folds (instead of opening them up and going inside them)
I don't think I know any editor that has this feature
I can't reproduce this as the video is showing. I've only came close, if the foldings were closed.
Can you share your folding config? Perhaps mine it's different.
Hey, I should mention that I no longer use this plugin so idk if this issue still applies. my folding config:
vim.o.foldmethod = 'expr' -- Tree sitter folding
vim.o.foldexpr = 'nvim_treesitter#foldexpr()' -- Tree sitter folding
vim.o.foldtext = "substitute(getline(v:foldstart),'\t',repeat(' ',&tabstop),'g').' ... '.trim(getline(v:foldend))" -- Sexy minimal folds
vim.o.foldnestmax = 10 -- Maximum amount of nested folds
vim.o.foldminlines = 1 -- Minimum amount of lines per fold
it should look like this
Thanks! The bug happens when foldexpr is set to nvim_treesitter#foldexpr().
The trick was to update the folds after the block was moved.