SublimeText / PackageDev

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

added keybindings for syntax test development #82

Closed keith-hall closed 7 years ago

keith-hall commented 7 years ago

added keybindings and a visual helper for syntax test development as referenced to from https://github.com/SublimeText/PackageDev/issues/71#issuecomment-267342418

jcberquist commented 7 years ago

@keith-hall: This is minor, but would you consider adjusting the highlight listener to not erase the current_syntax_test region if it is unchanged? Currently, as the cursor moves on the test line, the highlight region flickers as it is erased and redrawn.

jcberquist commented 7 years ago

@keith-hall: Thanks! Am I right that you don't actually need to erase the region explicitly if you call view.add_regions() again with the same key? I think it overwrites what is already there?

keith-hall commented 7 years ago

great idea @jcberquist - and thanks for the tip! it works perfectly and saved me lots of time ;)

keith-hall commented 7 years ago

out of interest, does anyone ever really work with multiple cursors while writing syntax tests? I don't, and so I've only added support for the 1st cursor in this PR so far.

FichteFoll commented 7 years ago

out of interest, does anyone ever really work with multiple cursors while writing syntax tests?

I do occasionally, but mostly for aligning which doesn't conflict with this feature.

keith-hall commented 7 years ago

I've made some improvements as suggested, thanks :) I will probably only have time to make more after the weekend, but if I can tomorrow, I will try :)

FichteFoll commented 7 years ago

Just a note that I'll most likely be focussing my time on writing the Package Control channel review tool (and actually doing the reviews) before working on PackageDev. No ETA.

keith-hall commented 7 years ago

I believe I have addressed all the points you raised in your review, @FichteFoll.

I've also got it to suggest partial scopes: ezgif com-8d856ff244

and cope with comment end markers: ezgif com-122ca4c117

And proved it works nicely with line comments that also scope the trailing newline: ezgif com-710925ebe9

FichteFoll commented 7 years ago

Looks awesome. Thanks for addressing my feedback so quickly. I intend to do more work with this package before the end of the year (holidays, yay), and will hopefully merge this and work on other parts that have been bothering me for a long while.