Skip to content

$0 behaves differently depending on its content #1217

@ofseed

Description

@ofseed

All snippets are provided in the vscode format

The following snippet makes the last node of the snippet where the $0 is.

${1:var} = $0;

The following do the same, after jumping to $0, luasnip.jump(1) will no longer take effect, nvim will keep select mode no matter how luasnip.jump(1) is called.

${1:var} = ${0:nil};

The problem occurs in the following snippet. Ideally, it should behave all the same as the last one, i.e. after jumping to $0, luasnip.jump(1) should not take effect, but the actual situation is different, the calling luasnip.jump(1) again will move the cursor to the position before semicolon and enter insert mode.

${1:var} = ${0:$TM_FILENAME_BASE};

I've tested the same cases in vscode, luasnip behaves differently with vscode.

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