From 6f1a7b1220c2ae565a2542fb089eb6d87f0a9421 Mon Sep 17 00:00:00 2001 From: Kirawi Date: Sun, 28 Nov 2021 20:38:17 -0500 Subject: Add llvm grammar (#1167) --- book/src/themes.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'book/src/themes.md') diff --git a/book/src/themes.md b/book/src/themes.md index ecbbb6e9..fd3f5b1e 100644 --- a/book/src/themes.md +++ b/book/src/themes.md @@ -145,11 +145,12 @@ We use a similar set of scopes as - `conditional` - `if`, `else` - `repeat` - `for`, `while`, `loop` - `import` - `import`, `export` - - (TODO: return?) + - `return` + - `operator` - `or`, `in` - `directive` - Preprocessor directives (`#if` in C) - `function` - `fn`, `func` -- `operator` - `||`, `+=`, `>`, `or` +- `operator` - `||`, `+=`, `>` - `function` - `builtin` -- cgit v1.2.3-70-g09d2 From 40969ad4528bbb774e2b95dce0749b1dd3734ebf Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Wed, 15 Dec 2021 17:46:40 +0900 Subject: Partly fix latex highlights and add markup scope docs --- book/src/themes.md | 14 ++++++++++++++ runtime/queries/latex/highlights.scm | 26 +++++++++++++------------- 2 files changed, 27 insertions(+), 13 deletions(-) (limited to 'book/src/themes.md') diff --git a/book/src/themes.md b/book/src/themes.md index fd3f5b1e..b6de7002 100644 --- a/book/src/themes.md +++ b/book/src/themes.md @@ -162,6 +162,20 @@ We use a similar set of scopes as - `namespace` +- `markup` + - `heading` + - `list` + - `unnumbered` + - `numbered` + - `bold` + - `italic` + - `underline` + - `link` + - `quote` + - `raw` + - `inline` + - `block` + #### Interface These scopes are used for theming the editor interface. diff --git a/runtime/queries/latex/highlights.scm b/runtime/queries/latex/highlights.scm index f045c82d..8406bd04 100644 --- a/runtime/queries/latex/highlights.scm +++ b/runtime/queries/latex/highlights.scm @@ -318,60 +318,60 @@ ["[" "]" "{" "}"] @punctuation.bracket ;"(" ")" is has no special meaning in LaTeX (chapter - text: (brace_group) @text.title) + text: (brace_group) @markup.heading) (part - text: (brace_group) @text.title) + text: (brace_group) @markup.heading) (section - text: (brace_group) @text.title) + text: (brace_group) @markup.heading) (subsection - text: (brace_group) @text.title) + text: (brace_group) @markup.heading) (subsubsection - text: (brace_group) @text.title) + text: (brace_group) @markup.heading) (paragraph - text: (brace_group) @text.title) + text: (brace_group) @markup.heading) (subparagraph - text: (brace_group) @text.title) + text: (brace_group) @markup.heading) ((environment (begin name: (word) @_frame) (brace_group - child: (text) @text.title)) + child: (text) @markup.heading)) (#eq? @_frame "frame")) ((generic_command name:(generic_command_name) @_name arg: (brace_group - (text) @text.title)) + (text) @markup.heading)) (#eq? @_name "\\frametitle")) ;; Formatting ((generic_command name:(generic_command_name) @_name - arg: (_) @text.emphasis) + arg: (_) @markup.italic) (#eq? @_name "\\emph")) ((generic_command name:(generic_command_name) @_name - arg: (_) @text.emphasis) + arg: (_) @markup.italic) (#match? @_name "^(\\\\textit|\\\\mathit)$")) ((generic_command name:(generic_command_name) @_name - arg: (_) @text.strong) + arg: (_) @markup.bold) (#match? @_name "^(\\\\textbf|\\\\mathbf)$")) ((generic_command name:(generic_command_name) @_name . - arg: (_) @text.uri) + arg: (_) @markup.underline.link) (#match? @_name "^(\\\\url|\\\\href)$")) (ERROR) @error -- cgit v1.2.3-70-g09d2