Skip to content

Commit 49cb76a

Browse files
committed
Improve variable decl keywords
1 parent abc0f08 commit 49cb76a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

utils/swift-mode.el

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@
4545
"import" "let" "protocol" "static" "struct" "subscript"
4646
"typealias" "enum" "var" "lazy" "where"
4747
"private" "public" "internal" "override" "throws" "rethrows"
48-
"open" "associatedtype" "get" "set" "willSet" "didSet"
49-
"inout" "indirect" "final")
48+
"open" "associatedtype" "inout" "indirect" "final")
5049
'words) . font-lock-keyword-face)
50+
;; Variable decl keywords
51+
`("\\b\\(?:[^a-zA-Z_0-9]*\\)\\(get\\|set\\)\\(?:[^a-zA-Z_0-9]*\\)\\b" 1 font-lock-keyword-face)
52+
`(,(regexp-opt '("willSet" "didSet") 'words) . font-lock-keyword-face)
5153
;; Operators
5254
`("\\b\\(\\(pre\\|post\\|in\\)fix\\s-+\\)operator\\b" . font-lock-keyword-face)
5355
;; Infix operator attributes

0 commit comments

Comments
 (0)