SublimeText / PackageDev

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

[ST4] Add new context keys. #315

Closed UltraInstinct05 closed 3 years ago

UltraInstinct05 commented 3 years ago
This PR adds context keys that have been added in various builds of ST4 starting from 4050. The following table summarizes them Key Operand Operators Match All Description Added in
"overlay_has_focus" boolean equality no Whether the overlay currently open, has focus. 4082
"overlay_name" string equality no The name of the overlay. Valid values are "goto" & "command_palette" 4082
"group_has_multiselect" boolean equality no Whether the currently focused group has multi selected tabs. 4050
"group_has_transient_sheet" boolean equality no Whether the currently focused group has a transient sheet. 4050
"has_snippet" boolean equality no Whether the immediate word before the cursor can be expanded to a snippet. 4050
"is_javadoc" boolean equality yes 4050

As to the is_javadoc one, I have no idea how to trigger it & what it does. So I have marked the details for it as a TODO.

keith-hall commented 3 years ago

Fwiw, your summary for has_snippet is incorrect, but you got it right in the completion file - just writing about it here in case anyone else is confused by that. Thanks for this btw :)

UltraInstinct05 commented 3 years ago

Thanks. I'll edit & correct it.

UltraInstinct05 commented 3 years ago

I had forgotten to add these context keys to the syntax file for appropriate highlighting. I have made a commit that does so.

FichteFoll commented 3 years ago

Thanks for the additions. Should perhaps also notify Will that these aren't in the ST4 docs either, if he's not aware of it already.