Skip to content

Backslash blocks don't work well #25

@thomasahle

Description

@thomasahle

I would like to have a \langle ... \rangle surround for use in latex.
Hence I have defined:

let g:operator#surround#blocks = {
\ '-' : [
\   {'block': ['\langle', '\rangle'], 'motionwise': ['char', 'line', 'block'], 'keys': ['<', '>']},
\ ] }

And the following block with vim-textobj-user:

call textobj#user#plugin('latex', {
\   'code': {'pattern': ['\\langle\>', '\\rangle\>'], 'select-a': 'a<', 'select-i': 'i<' },
\ })

This allows me to change () to \langle\rangle using sra(<.
However I cannot change back. That is sra<( beeps and does nothing.
If I change to 'block': ['\\langle', '\\rangle'] I can do sra<(,
but then the original command inserts the wrong thing \\langle\\rangle

I seems to me this could be fixed by making sure we always search literaly, rather than using regex, when changing or deleting a surround.

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