Closed AckslD closed 3 years ago
For the moment I don't see a clean way to do this. In order to restore the visual block selection I would need to modify it somehow. I see two ways.
nvim_feedkeys
: simulate the key presses to reselect the block. The downside to this is that it could trigger keymapping such as the issue #5 .'<
and '>
). Vim has a patch which allows to do this but it hasn't been ported to Neovim? At least, I can't make it work on my config.Maybe I'm not seeing something but currently I would rather go the safe way.
I will try to see I can merge some PRs into Neovim to make it work that would great.
Could you try with the latest commit?
I found a way which would not trigger any keymapping and reselect the latest selection with exe "norm! ..."
.
Cool, I'll try it. Maybe this it what you did but couldn't you nvim_buf_get_mark()
to get the <
and >
before doing anything and then after set them by putting the cursor there using setpos
followed by norm m<
and same for >
?
Can confirm that the latest commit indeed works for me :+1:
Cool, I'll try it. Maybe this it what you did but couldn't you
nvim_buf_get_mark()
to get the<
and>
before doing anything and then after set them by putting the cursor there usingsetpos
followed bynorm m<
and same for>
?
This would work I think, assuming the column is corrected because setpos
is byte based and all the multi-bytes characters which venn
insert it will shift the column position. This could be another way.
It seems
venn
changes the last visual selection. For example if I select some visual block and do:VBox
and thengv
then it does not select same same region anymore.Maybe the last visual selection could be saved before drawing the box and then restored again after?