Skip to content

Commit 7b8c9b5

Browse files
authored
fix: R: Conform to Emacs highlighting conventions (#759)
* fix: increase special face priority * fix: Apply variable only when declared, not used
1 parent a08bfbf commit 7b8c9b5

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

queries/r/highlights.scm

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535

3636
(comma) @punctuation.delimiter
3737

38-
; Variables
39-
40-
(identifier) @variable
41-
4238
; Functions
4339

4440
(binary_operator
@@ -62,6 +58,20 @@
6258
(parameters (parameter name: (identifier) @variable.parameter))
6359
(arguments (argument name: (identifier) @variable.parameter))
6460

61+
; Variables
62+
63+
(binary_operator
64+
lhs: (identifier) @variable
65+
operator: "="
66+
rhs: (_)
67+
)
68+
69+
(binary_operator
70+
lhs: (identifier) @variable
71+
operator: "<-"
72+
rhs: (_)
73+
)
74+
6575
; Namespace
6676

6777
(namespace_operator lhs: (identifier) @namespace)

0 commit comments

Comments
 (0)