Sublime Forum

Quickly adding syntax tests using keyboard shortcuts

#1

I’ve figured out that if you press Tab in a syntax_test_* file on a line that has the test prefix (# in my case), it jumps to the next column, adds carets and the appropriate scopes. I’ve also found that when you use ^, you can step through the meta scopes, and once the meta scopes are added to a line’s tests, subsequent auto-generated tests exclude it, thus making them much more readable. This is great, and dramatically speeds up writing tests when you have a syntax file that’s working correctly.

But Tab finds the last column n with a test of any sort from the previous line and starts the next test in column n+1. That means that you can easily insert a meta test with something like #^^^, but then you have to manually line up the next test using Shift+Tab to get Tab working again to easily insert more tests.

Is there some shortcut I’m missing which will let you jump to the next scoped string? Similar to how ^ works when you use it repeatedly, but for substrings with successive scopes, not just meta scopes? Or something that will work like Tab, but be smarter about meta scopes and thus know that I haven’t fully tested a column that only has a meta scope from the previous line?

0 Likes

#2

There’s no way to do this, and so I’ve added a couple of feature requset issues in the PackageDev repo about it:

0 Likes