summaryrefslogtreecommitdiff
path: root/public/vendor/codemirror/addon/wrap/hardwrap.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/vendor/codemirror/addon/wrap/hardwrap.js')
-rw-r--r--public/vendor/codemirror/addon/wrap/hardwrap.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/public/vendor/codemirror/addon/wrap/hardwrap.js b/public/vendor/codemirror/addon/wrap/hardwrap.js
index 8806fbe2..04851f99 100644
--- a/public/vendor/codemirror/addon/wrap/hardwrap.js
+++ b/public/vendor/codemirror/addon/wrap/hardwrap.js
@@ -30,7 +30,9 @@
}
function findBreakPoint(text, column, wrapOn, killTrailingSpace) {
- for (var at = column; at > 0; --at)
+ var at = column
+ while (at < text.length && text.charAt(at) == " ") at++
+ for (; at > 0; --at)
if (wrapOn.test(text.slice(at - 1, at + 1))) break;
for (var first = true;; first = false) {
var endOfText = at;