Browse Source

[visual] Decorate keywords command (#13724)

GitOrigin-RevId: ffd737705098c8a3eb0de5fe8ffbbc656c30d17c
Alf Eaton 2 years ago
parent
commit
6270dd0e2a

+ 12 - 0
services/web/frontend/js/features/source-editor/extensions/visual/atomic-decorations.ts

@@ -1029,6 +1029,18 @@ export const atomicDecorations = (options: Options) => {
                     )
                   )
                 }
+              } else if (commandName === '\\keywords') {
+                if (shouldDecorate(state, nodeRef)) {
+                  // command name and opening brace
+                  decorations.push(
+                    ...decorateArgumentBraces(
+                      new BraceWidget('keywords: '),
+                      textArgumentNode,
+                      nodeRef.from
+                    )
+                  )
+                  return false
+                }
               } else if (
                 commandName === '\\footnote' ||
                 commandName === '\\endnote'