SublimeText / PackageDev

Tools to ease the creation of snippets, syntax definitions, etc. for Sublime Text.
MIT License
436 stars 83 forks source link

Extend carets further in syntax test completions. #202

Closed Thom1729 closed 5 years ago

Thom1729 commented 5 years ago

When extending assertions in syntax tests, keep extending the assertion until the asserted scope would change.

Given (curly brackets denote selection):

// SYNTAX TEST "Packages/JavaScript/JavaScript.sublime-syntax"

  [a, b, c, d]
//^{ meta.sequence punctuation.section.brackets.begin}

When you type a caret, the old result was:

// SYNTAX TEST "Packages/JavaScript/JavaScript.sublime-syntax"

  [a, b, c, d]
//^^{ meta.sequence}

And the new result is:

// SYNTAX TEST "Packages/JavaScript/JavaScript.sublime-syntax"

  [a, b, c, d]
//^^^^^^^^^^^^{ meta.sequence}
FichteFoll commented 5 years ago

I've always wanted this, but was too lazy to implement it whenever it bothered me until I eventually forgot about it again. Thanks.