From 03f7cb4e00edaa393f43cddda573de9bbe99d417 Mon Sep 17 00:00:00 2001 From: Koen Lageveen Date: Fri, 4 May 2018 08:05:53 +0200 Subject: [PATCH] correct highlighting of n+- in :nth-child(2n+1) --- LESS.sublime-syntax | 6 +++++- syntax_test_less.less | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/LESS.sublime-syntax b/LESS.sublime-syntax index fbb0b26..8e5e711 100644 --- a/LESS.sublime-syntax +++ b/LESS.sublime-syntax @@ -464,8 +464,12 @@ contexts: pop: true - match: '\(' scope: meta.group.css punctuation.section.group.begin.css - - match: '[0-9]+' + - match: '[+-]' + scope: keyword.operator.css + - match: '[0-9]+(n*)' scope: meta.group.css constant.numeric.css + captures: + 1: keyword.other.unit.css - match: (:|::)(selection|first-line|first-letter|before|backdrop|after)\b scope: meta.selector.css entity.other.pseudo-element.css captures: diff --git a/syntax_test_less.less b/syntax_test_less.less index 0114570..04474ea 100755 --- a/syntax_test_less.less +++ b/syntax_test_less.less @@ -228,6 +228,9 @@ html::before { .avatar:not(.class) {} /* ^ meta.group.css entity.other.attribute-name.class.css */ /* ^ meta.group.css punctuation.section.group.end.css */ +.class#id:nth-child(2n-1) {} +/* ^ constant.numeric.css keyword.other.unit.css */ +/* ^ keyword.operator.css */ .avatar:nth-child(3) { /* ^ entity.other.pseudo-class.css punctuation.definition.entity.css */ /*. ^ entity.other.pseudo-class.css */