From 366d6fe759f1261f9573805d3585669ceda9810a Mon Sep 17 00:00:00 2001 From: Carson Riker Date: Wed, 4 Nov 2020 10:01:56 -0500 Subject: [PATCH] Check for division before we check for regexes --- rc/filetype/javascript.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/javascript.kak b/rc/filetype/javascript.kak index fdac14af3..5a8d05db2 100644 --- a/rc/filetype/javascript.kak +++ b/rc/filetype/javascript.kak @@ -81,9 +81,9 @@ define-command -hidden init-javascript-filetype -params 1 %~ add-highlighter "shared/%arg{1}/comment_line" region // '$' fill comment add-highlighter "shared/%arg{1}/comment" region /\* \*/ fill comment add-highlighter "shared/%arg{1}/shebang" region ^#! $ fill meta + add-highlighter "shared/%arg{1}/division" region '[\w\)\]]\K(/|(\h+/\h+))' '(?=\w)' group # Help Kakoune to better detect /…/ literals add-highlighter "shared/%arg{1}/regex" region / (?][\w:.-]* (?][\w:.-]*(?!\hextends)(?=[\s/>])(?!>\()) (|/>) regions - add-highlighter "shared/%arg{1}/division" region '[\w\)\]]\K(/|(\h+/\h+))' '(?=\w)' group # Help Kakoune to better detect /…/ literals # Regular expression flags are: g → global match, i → ignore case, m → multi-lines, u → unicode, y → sticky # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp