Skip to content

Coc multi cursor edits behave incorrectly #5267

@asmodeus812

Description

@asmodeus812

Describe the bug

Having the following text, we select with coc-cursors-operator from the equals sign to the end of the line gh$ for both lines, in any order

LANG=en_US.UTF-8
HOSTTYPE=x86_64
    vim.cmd [[
        xnoremap <silent> gh <Plug>(coc-cursors-range)
        nnoremap <silent> gh <Plug>(coc-cursors-operator)
    ]]

Then we move to the line HOSTTYPE=x86_64 and put the cursor at the first character after the equals sign - the x, and press C or c$, the editing happens as if block editing occurs, i.e the first line is cut/deleted only after/at S.UTF-8 instead deleting the selected part en_US.UTF-8. This happens only if the line we edit on is shorter than the other selections, i.e in this case x86_64, if we had done the delete from the line en_US that would work kind of as expected. However this is not very good since we can not always tell which line/selection is the longest (especially if not all selections are in the viewport at the moment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions