Skip to content
Snippets Groups Projects
Commit 09ee68ff authored by kaniga's avatar kaniga Committed by Marijn Haverbeke
Browse files

added a trim check to prevent matching of white-spaces (which causes delays in large documents)

parent 04c03d08
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,7 @@
function markDocument(cm, className, minChars) {
clearMarks(cm);
minChars = (typeof minChars !== 'undefined' ? minChars : DEFAULT_MIN_CHARS);
if (cm.somethingSelected() && cm.getSelection().length >= minChars) {
if (cm.somethingSelected() && cm.getSelection().replace(/^\s+|\s+$/g, "").length >= minChars) {
var state = getMatchHighlightState(cm);
var query = cm.getSelection();
cm.operation(function() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment