From 51bfd3f3fe62f4fdef571b02dfb06033d1e93ba9 Mon Sep 17 00:00:00 2001 From: Ashwin Shenoy Date: Tue, 17 Nov 2020 18:00:30 +0530 Subject: [PATCH 1/2] Add new context keys. This commit adds new context keys that have been introduced in the various ST4 builds. --- .../Context Key Values.sublime-completions | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Package/Sublime Text Keymap/Completions/Context Key Values.sublime-completions b/Package/Sublime Text Keymap/Completions/Context Key Values.sublime-completions index b2e6faa9..63c98217 100644 --- a/Package/Sublime Text Keymap/Completions/Context Key Values.sublime-completions +++ b/Package/Sublime Text Keymap/Completions/Context Key Values.sublime-completions @@ -92,5 +92,35 @@ "details": "Match the scope at the end of the line", "kind": ["variable", "k", "key"], }, + { + "trigger": "overlay_has_focus", + "details": "Overlay has focus", + "kind": ["variable", "k", "key"], + }, + { + "trigger": "overlay_name", + "details": "Name of the overlay open", + "kind": ["variable", "k", "key"], + }, + { + "trigger": "group_has_multiselect", + "details": "Group has multiselected tabs", + "kind": ["variable", "k", "key"], + }, + { + "trigger": "group_has_transient_sheet", + "details": "Group has a transient sheet", + "kind": ["variable", "k", "key"], + }, + { + "trigger": "has_snippet", + "details": "Word before cursor expands to a snippet", + "kind": ["variable", "k", "key"], + }, + { + "trigger": "is_javadoc", + // "details": "TODO", + "kind": ["variable", "k", "key"], + } ] } From 012bb331e37a78e273f3559be945803a0db93612 Mon Sep 17 00:00:00 2001 From: Ashwin Shenoy Date: Sun, 22 Nov 2020 15:29:03 +0530 Subject: [PATCH 2/2] Add highlighting for the new context keys. This commit adds the new context keys to the syntax file for appropriate highlighting. --- .../Sublime Text Keymap/Sublime Text Keymap.sublime-syntax | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Package/Sublime Text Keymap/Sublime Text Keymap.sublime-syntax b/Package/Sublime Text Keymap/Sublime Text Keymap.sublime-syntax index 3548775f..afa71967 100644 --- a/Package/Sublime Text Keymap/Sublime Text Keymap.sublime-syntax +++ b/Package/Sublime Text Keymap/Sublime Text Keymap.sublime-syntax @@ -425,8 +425,10 @@ contexts: - match: |- (?x)(")((?:preceding_|following_)?text|num_selections|selection_empty |has_(?:next|prev)_field - |(?:panel|overlay|auto_complete|popup)_visible|panel|panel_has_focus - |last_command|indented_block + |(?:panel|auto_complete|popup)_visible|panel|panel_has_focus + |last_command|indented_block|has_snippet|is_javadoc + |overlay_(?:has_focus|visible|name) + |group_has_(?:multiselect|transient_sheet) )(") scope: meta.context.key-value.key.other.sublime-keymap string.quoted.double.json captures: