benmatselby / sublime-phpcs

🔍 PHP CodeSniffer, PHP Coding Standard Fixer, Linter, and Mess Detector Support for Sublime Text
Other
812 stars 126 forks source link

Add on_query_context handler for visible regions #201

Closed srichter closed 1 year ago

srichter commented 3 years ago

This tracks the state of regions added by the plugin and adds a context key for querying that state. It allows someone to set up a conditional keybind to clear the regions, e.g.:

{ "keys": ["escape"], "command": "phpcs_clear_sniffer_marks", "context":
    [
        { "key": "phpcs.regions_visible", "operator": "equal", "operand": true }
    ]
}
benmatselby commented 3 years ago

Thanks for the contribution @srichter

I'm currently not working with PHP, or Sublime, so cannot quickly test this. It may be a while before I can rig this all back up. Apologies.