mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 17:43:42 -05:00
allow capital letters in ref commands e.g. \Cref
This commit is contained in:
parent
1b50f0ced8
commit
3548f61615
1 changed files with 2 additions and 2 deletions
|
@ -89,7 +89,7 @@ define [
|
||||||
getCompletions: (editor, session, pos, prefix, callback) ->
|
getCompletions: (editor, session, pos, prefix, callback) ->
|
||||||
{commandFragment} = Helpers.getContext(editor, pos)
|
{commandFragment} = Helpers.getContext(editor, pos)
|
||||||
if commandFragment
|
if commandFragment
|
||||||
refMatch = commandFragment.match(/^~?\\([a-z]*ref){([^}]*, *)?(\w*)/)
|
refMatch = commandFragment.match(/^~?\\([a-zA-Z]*ref){([^}]*, *)?(\w*)/)
|
||||||
if refMatch
|
if refMatch
|
||||||
[_, commandName, currentArg] = refMatch
|
[_, commandName, currentArg] = refMatch
|
||||||
result = []
|
result = []
|
||||||
|
@ -184,7 +184,7 @@ define [
|
||||||
, 0
|
, 0
|
||||||
if (
|
if (
|
||||||
change.action == "insert" and
|
change.action == "insert" and
|
||||||
/(begin|end|[a-z]*ref|usepackage|[a-z]*cite[a-z]*|input|include)/.test(
|
/(begin|end|[a-zA-Z]*ref|usepackage|[a-z]*cite[a-z]*|input|include)/.test(
|
||||||
change.lines[0].match(/\\(\w+){}/)?[1]
|
change.lines[0].match(/\\(\w+){}/)?[1]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue