Support @boolean and @character highlighting queries

pull/241/head
Wilfred Hughes 2022-04-03 22:36:15 +07:00
parent 10a0e2dba9
commit bdb68cd676
5 changed files with 18 additions and 3 deletions

@ -6,6 +6,9 @@ The side-by-side display no longer pads the right column to fill the
terminal. This improves display when the terminal is slightly shrunk,
or when wide characters (e.g. emoji) are used.
Improved syntax highlighting for boolean constants and character
literals.
### Parsing
Added Gleam, YAML and Zig support.

@ -35,7 +35,7 @@ sample_files/hack_before.php sample_files/hack_after.php
b8c51005df7e1eaaeaf738a4353ac88f -
sample_files/haskell_before.hs sample_files/haskell_after.hs
3472e360147d80639f50795dcc172648 -
9c668c79e56f1e1cecf1c02759c195a9 -
sample_files/helpful_before.el sample_files/helpful_after.el
bce74573e003cc6b729a63a4bc34c4af -

@ -1,5 +1,8 @@
foo x = x + 1
bar _ = 'c'
-- | Goodbye world
bar y = y + 2
isOne 1 = True
isOne _ = False

@ -1,5 +1,8 @@
foo x = x + 1
bar _ = 'c'
-- | Hello world
bar y = y + 1
isOne 1 = True
isOne _ = False

@ -621,6 +621,9 @@ fn tree_highlights(
if let Some(idx) = config.highlight_query.capture_index_for_name("constant") {
keyword_ish_capture_ids.push(idx);
}
if let Some(idx) = config.highlight_query.capture_index_for_name("boolean") {
keyword_ish_capture_ids.push(idx);
}
if let Some(idx) = config
.highlight_query
.capture_index_for_name("constant.builtin")
@ -632,6 +635,9 @@ fn tree_highlights(
if let Some(idx) = config.highlight_query.capture_index_for_name("string") {
string_capture_ids.push(idx);
}
if let Some(idx) = config.highlight_query.capture_index_for_name("character") {
string_capture_ids.push(idx);
}
let mut type_capture_ids = vec![];
if let Some(idx) = config.highlight_query.capture_index_for_name("type") {