vim-cycle icon indicating copy to clipboard operation
vim-cycle copied to clipboard

Incorrect visual selection with g:cycle_auto_visual=1 for subpairs with cursor on end_with

Open kiryph opened this issue 8 years ago • 0 comments

I have defined following rule for latex:

let g:cycle_default_groups_for_tex = [
  \   [['(:)',   '\left(:\right)',   '\mleft(:\mright)',   '\bigl(:\bigr)',   '\Bigl(:\Bigr)',   '\biggl(:\biggr)',   '\Biggl(:\Biggr)'],   'sub_pairs', 'hard_case', 'match_case'],
 \ ]

However, it does not work as expected in all circumstances. Consider this

(a+b)

Cursor on (. If I now cycle to the next item in the group, I get what I want:

\left(a+b\right)

However, the cursor remains on ( and cycling now to the next item leads to following result

\left\left(a+b\right\right)

The option g:cycle_auto_visual helps, but does not work correctly if I place the cursor on the closing delimiter:

cycle-auto-visual-on-end-with

Any suggestions to make this group work are helpful.

kiryph avatar Aug 07 '17 13:08 kiryph