change regex to match single backslash and command fragment

This commit is contained in:
Nate Stemen 2017-10-24 16:35:28 +01:00
parent c437eb37d5
commit 829595777c
2 changed files with 3 additions and 2 deletions

View file

@ -229,6 +229,7 @@ define [
99999
)
)
if lineBeyondCursor
if partialCommandMatch = lineBeyondCursor.match(/^([a-z0-9]+)\{/)
# We've got a partial command after the cursor

View file

@ -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