Skip to content

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

Open
@kiryph

Description

@kiryph

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions