mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
change regex to match single backslash and command fragment
This commit is contained in:
parent
c437eb37d5
commit
829595777c
2 changed files with 3 additions and 2 deletions
|
@ -229,6 +229,7 @@ define [
|
|||
99999
|
||||
)
|
||||
)
|
||||
|
||||
if lineBeyondCursor
|
||||
if partialCommandMatch = lineBeyondCursor.match(/^([a-z0-9]+)\{/)
|
||||
# We've got a partial command after the cursor
|
||||
|
|
|
@ -17,8 +17,8 @@ define [
|
|||
# \includegraphics[width=\textwidth]{..
|
||||
# should not match the \textwidth.
|
||||
blankArguments = lineUpToCursor.replace /\[([^\]]*)\]/g, (args) ->
|
||||
Array(args.length+1).join('.')
|
||||
if m = blankArguments.match(/(\\[^\\]+)$/)
|
||||
Array(args.length + 1).join('.')
|
||||
if m = blankArguments.match(/(\\[^\\]*)$/)
|
||||
return m.index
|
||||
else
|
||||
return -1
|
||||
|
|
Loading…
Reference in a new issue