vim-textobj-user icon indicating copy to clipboard operation
vim-textobj-user copied to clipboard

'< and '> are not restored with right unit

Open kana opened this issue 8 years ago • 5 comments

From: https://github.com/kana/vim-textobj-user/issues/56#issuecomment-331746213

Perhaps semi-related: I'm noticing that when I specifically do a yie, the '< and '> marks are no longer what they should be if the last visually-selected area was character-wise (i.e. a word)

For example, vjjj<Esc>yaegv reselect the same region as vjjj but it is line-wise instead of character-wise.

kana avatar Sep 25 '17 11:09 kana

I've looked into the problem. It seems not to be possible to solve at the moment. Because vim-textobj-user internally uses v/V/<C-v> to select a proper region. So that the type of the last Visual mode (used by gv) is overridden. And there is no way to reset the type other than v/V/<C-v>… but these keys are not always available (especially for c).

kana avatar Sep 26 '17 11:09 kana

It might be possible to solve the problem by restructuring the internal of vim-textobj-user not to use Visual mode directly. But it takes a long time to complete.

kana avatar Sep 26 '17 11:09 kana

I'll try writing a prototype later: https://github.com/kana/vim-textobj-user/compare/prototype-to-keep-last-visual-mode

kana avatar Sep 26 '17 13:09 kana

Hmm… I spent several hours on the problem and realized that it's not possible to solve the problem unless writing a patch to Vim. It's necessary to use Visual mode in vim-textobj-user for repeatability with the . command.

kana avatar Oct 02 '17 12:10 kana

Reviving an old issue, but is the last comment true with tpope/vim-repeat installed?

If I understand correctly, the changes described would allow move-n and move-p to stay in visual mode. Is that true, or a separate issue?

pianohacker avatar Nov 10 '18 00:11 pianohacker