Skip to content

Commit

Permalink
feat: raw strings: distinguish delimiters from actual string (#114)
Browse files Browse the repository at this point in the history
We could set the delimiters to a different highlight group. Example
`@punctuation.special`:

![image](https://github.com/user-attachments/assets/4903f641-48fe-42f4-87dd-6245c644447d)

To see all available groups, hit `:h treesitter-highlight-groups`. I
could see:
- `@punctuation.special`
- `@punctuation.delimiter`
- `@tag.delimiter`
- `@string.escape`
- `@string.special`
- `@string.special.symbol`

Any opinions?

Edit: with highlights now in `nvim-treesitter`, this feels a bit weird.
But we can still maintain our own highlights :D
  • Loading branch information
mrdgo authored Nov 28, 2024
1 parent 1c3821f commit 3a021cd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions queries/nu/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ file_path: (val_string) @variable.parameter
(escaped_interpolated_content) @string
(expr_interpolated ["(" ")"] @variable.parameter)

(raw_string_begin) @punctuation.special
(raw_string_content) @string
(raw_string_end) @punctuation.special

;;; ---
;;; operators
(expr_binary [
Expand Down

0 comments on commit 3a021cd

Please sign in to comment.