From fc322711ca1dd744a9aadccd40229381baa49859 Mon Sep 17 00:00:00 2001 From: James Allen Date: Fri, 28 Nov 2014 13:34:16 +0000 Subject: [PATCH] Highlight \ref, \vref, \cite and \citep as labels The `\ref`, and `\cite` commands in LaTeX are similar to `\label`s in that they refer to user defined labels elsewhere in the text, and it makes sense to highlight them with the same color scheme. Particularly the coloring of arguments to `\ref` commands should match the color of `\label` commands because `\label` defines the strings that `\ref` then references. --- lib/ace/mode/latex_highlight_rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ace/mode/latex_highlight_rules.js b/lib/ace/mode/latex_highlight_rules.js index f3238bfb..bf9b9f3b 100644 --- a/lib/ace/mode/latex_highlight_rules.js +++ b/lib/ace/mode/latex_highlight_rules.js @@ -19,7 +19,7 @@ var LatexHighlightRules = function() { }, { // A label token : ["keyword","lparen", "variable.parameter", "rparen"], - regex : "(\\\\label)(?:({)([^}]*)(}))?" + regex : "(\\\\(?:label|v?ref|cite(?:[^{]*)))(?:({)([^}]*)(}))?" }, { // A block token : ["storage.type", "lparen", "variable.parameter", "rparen"],