SublimeText / PackageDev

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

New pref to allow tabbing over whitespace during syntax test development #183

Closed keith-hall closed 6 years ago

keith-hall commented 6 years ago

Quite often when writing syntax tests, I don't add any assertions for whitespace (unless I am adding a negation for the previous assertion to confirm the scope is no longer active), as whitespaces typically don't receive any special scopes. Therefore, when I have a file like:

line being tested
# ^^ example1

and I create a new test line and press Tab, I then have to press Space^ to get assertions for the next non-whitespace span.

line being tested
# ^^ example1
#   ^ base_scope

This PR allows me to set a new preference called syntax_test.skip_whitespace to true, so that I can just press Tab and end up with:

line being tested
# ^^ example1
#    ^^^^^ example2

Hopefully other people will also find this useful :)