mirror of
https://github.com/overleaf/overleaf.git
synced 2024-09-16 02:52:31 -04:00
Reverse direction, don't ignore commands in comments
This commit is contained in:
parent
bd88adb621
commit
bb3c5e7a34
1 changed files with 3 additions and 6 deletions
|
@ -39,18 +39,15 @@ define [], () ->
|
||||||
return commands
|
return commands
|
||||||
|
|
||||||
# Ignore single letter commands since auto complete is moot then.
|
# Ignore single letter commands since auto complete is moot then.
|
||||||
# Ignore commands which occur after a comment character '%'
|
commandRegex: /\\([a-zA-Z][a-zA-Z]+)/
|
||||||
commandRegex: /^([^%]*?)\\([a-zA-Z][a-zA-Z]+)/m
|
|
||||||
|
|
||||||
nextCommand: () ->
|
nextCommand: () ->
|
||||||
i = @doc.search(@commandRegex)
|
i = @doc.search(@commandRegex)
|
||||||
if i == -1
|
if i == -1
|
||||||
return false
|
return false
|
||||||
else
|
else
|
||||||
matchObject = @doc.match(@commandRegex)
|
match = @doc.match(@commandRegex)[1]
|
||||||
preMatch = matchObject[1]
|
@doc = @doc.substr(i + match.length + 1)
|
||||||
match = matchObject[2]
|
|
||||||
@doc = @doc.substr(i + preMatch.length + match.length + 1)
|
|
||||||
return match
|
return match
|
||||||
|
|
||||||
consumeWhitespace: () ->
|
consumeWhitespace: () ->
|
||||||
|
|
Loading…
Reference in a new issue