From c1c61ed590edddcf57eb078a26ec736acc15836f Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 22 Nov 2017 21:22:36 +0300 Subject: [PATCH] find more rgb/hsl colors near cursor in comments and strings --- vendor-overwrites/colorpicker/colorview.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vendor-overwrites/colorpicker/colorview.js b/vendor-overwrites/colorpicker/colorview.js index 92e4e3d4..9d73f55a 100644 --- a/vendor-overwrites/colorpicker/colorview.js +++ b/vendor-overwrites/colorpicker/colorview.js @@ -215,7 +215,10 @@ function parseColorAtCursor(lineText, lineTextLC = lineText.toLowerCase(), ch) { const iHex = lineTextLC.lastIndexOf('#', ch); - const iParen = lineTextLC.lastIndexOf('(', ch); + const iParen = ( + lineTextLC.lastIndexOf('(', ch) + 1 || + lineTextLC.indexOf('(', ch) + 1 + ) - 1; let start = Math.max(iHex, iParen); let match, end, color, colorValue; if (start >= 0) {