Skip to content

Vim unexpectedly turns into visual mode for adjacent snippet placeholders #9236

Open
@adong660

Description

@adong660

After creating a snippet with several placeholders, my expected behavior is that, vim keeps in the insert mode, and the user inputs some letters in the first placeholder, and then presses the TAB key to go to the second to input, until all placeholders are filled. During this process, vim is always in the insert mode unless the user presses the ESC key. This holds for most cases so I think this should be the expected behavior.

However, if two placeholders in a snippet are directly adjacent, i.e. there's no other characters between them, when the user finishes filling the first placeholder, and presses TAB to go to the second, vim will unexpectedly go to the visual mode, selecting the second placeholder. If the second placeholder doesn't have another placeholder nested in it, pressing a c will deal with the case; otherwise, more key presses are necessary.

The attached MP4 video file shows the expected and unexpected behaviors mentioned above.

bandicam.2024-09-02.23-18-13-676.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions