Skip to content

Tabstops are lost when snippet trigger is beginning of parent snippet #1435

@oiiiiiiii

Description

@oiiiiiiii

Here is a minimal example to replicate the issue:

return {
	s("abc", fmt('a{} = "some {} string {}"', { i(1), i(2), i(3) })),
	s({
		trig = "(\\w)tri",
		trigEngine = "ecma",
	}, {
		t("a_"),
	}),
}

First I trigger the abc-snippet. Then I type "tri" for the second snippet and expand that one (either manually or set or by making it an autosnippet). Because "a" is part of the trigger (and the beginning of the parent snippet abc) the tabstops are lost and I can no longer jump into the string. When I replace

a{} = "some {} string {}"

with

local a{} = "some {} string {}"

it works, as now the beginning is not part of the trigger of the second snippet. I know the example seems useless but I have some real usecase (which is not as simple) that would require that to work.

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