Treat ${0} as the final snippet tab stop #30
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ondrejmirtes/autocomplete:snippet-final-stop"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Snippet field order is by number, but
${0}should be the final/exit stop --the position the cursor lands on after tabbing through the other fields --
matching the convention used by TextMate, LSP, VS Code, and others. It was
treated as plain field 0 and sorted first, so a snippet like
foo(${1:bar})${0}selected the empty
${0}instead ofbar.This orders
${0}after every other field (numbered and named), so the firstreal placeholder is selected and
${0}becomes the exit. Documented in thesnippetdocstring; test added.Snippet field order is by number, but ${0} should be the exit stop -- the position the cursor lands on after tabbing through the other fields -- to match the convention used by TextMate, LSP, VS Code, and others. It was sorted first (as field 0), so a snippet like foo(${1:bar})${0} selected the empty ${0} instead of bar. Order ${0} after every other field.I'd prefer an
if (seq == 0) seq = 1e9at line 53, for simplicity. Want to amend the patch or shall I?94ceb537d3to2557b9a771I force-pushed with your suggestion. Thank you!
Thanks! Merged.