From c418d2db832164440f3f40839a3d2e62ecc35ece Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 13 Jun 2017 19:48:57 +0800 Subject: [PATCH] add --- bi/base.js | 7 ++++++- docs/base.js | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bi/base.js b/bi/base.js index 23c9a67c6..5eda2b82f 100644 --- a/bi/base.js +++ b/bi/base.js @@ -17784,7 +17784,11 @@ BI.CodeEditor = BI.inherit(BI.Single, { var from = this.editor.getCursor(); this.editor.replaceSelection(param); var to = this.editor.getCursor(); - this.editor.markText(from, to, {className: 'param', atomic: true}); + var options = {className: 'param', atomic: true}; + if(BI.isNotNull(param.match(//))){ + options.className = 'error-param'; + } + this.editor.markText(from, to, options); this.editor.replaceSelection(" "); this.editor.focus(); }, @@ -17801,6 +17805,7 @@ BI.CodeEditor = BI.inherit(BI.Single, { _.forEach(line.markedSpans, function (i, ms) { switch (i.marker.className) { case "param": + case "error-param": var fieldNameLength = i.to - i.from; value = value.substr(0, i.from + num) + "$\{" + value.substr(i.from + num, fieldNameLength) + "\}" + value.substr(i.to + num, value.length); num += 3; diff --git a/docs/base.js b/docs/base.js index 23c9a67c6..5eda2b82f 100644 --- a/docs/base.js +++ b/docs/base.js @@ -17784,7 +17784,11 @@ BI.CodeEditor = BI.inherit(BI.Single, { var from = this.editor.getCursor(); this.editor.replaceSelection(param); var to = this.editor.getCursor(); - this.editor.markText(from, to, {className: 'param', atomic: true}); + var options = {className: 'param', atomic: true}; + if(BI.isNotNull(param.match(//))){ + options.className = 'error-param'; + } + this.editor.markText(from, to, options); this.editor.replaceSelection(" "); this.editor.focus(); }, @@ -17801,6 +17805,7 @@ BI.CodeEditor = BI.inherit(BI.Single, { _.forEach(line.markedSpans, function (i, ms) { switch (i.marker.className) { case "param": + case "error-param": var fieldNameLength = i.to - i.from; value = value.substr(0, i.from + num) + "$\{" + value.substr(i.from + num, fieldNameLength) + "\}" + value.substr(i.to + num, value.length); num += 3;