fix whitespace

This commit is contained in:
Philipp Kühn
2018-11-08 16:40:45 +01:00
parent a7d3af30bb
commit c5d7ef4e79

View File

@@ -28,6 +28,7 @@ function triggerCharacter({
// JavaScript doesn't have lookbehinds; this hacks a check that first character is " " // JavaScript doesn't have lookbehinds; this hacks a check that first character is " "
// or the line beginning // or the line beginning
const matchPrefix = match.input.slice(Math.max(0, match.index - 1), match.index) const matchPrefix = match.input.slice(Math.max(0, match.index - 1), match.index)
if (/^[\s\0]?$/.test(matchPrefix)) { if (/^[\s\0]?$/.test(matchPrefix)) {
// The absolute position of the match in the document // The absolute position of the match in the document
const from = match.index + $position.start() const from = match.index + $position.start()
@@ -52,8 +53,10 @@ function triggerCharacter({
} }
} }
} }
match = regexp.exec(text) match = regexp.exec(text)
} }
return position return position
} }
} }