mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #77 from sharelatex/ns-autocomplete-insertion-bug
fix autocomplete insertion on single backslash; Fixes #55
This commit is contained in:
commit
1a8a915116
2 changed files with 3 additions and 2 deletions
|
@ -229,6 +229,7 @@ define [
|
|||
99999
|
||||
)
|
||||
)
|
||||
|
||||
if lineBeyondCursor
|
||||
if partialCommandMatch = lineBeyondCursor.match(/^([a-zA-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