mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #1672 from sharelatex/ns-input-autocomplete
improve autocomplete when inserting over existing arguments GitOrigin-RevId: 8d1401cca141348dd33b965c92e120cf66350d7e
This commit is contained in:
parent
385da07930
commit
61cd448832
1 changed files with 14 additions and 0 deletions
|
@ -382,6 +382,20 @@ define([
|
|||
)
|
||||
}
|
||||
}
|
||||
const inArgument = lineBeyondCursor.match(
|
||||
/^([\w._-]+)\}(.*)/
|
||||
)
|
||||
if (inArgument) {
|
||||
const argumentRightOfCursor = inArgument[1]
|
||||
const afterArgument = inArgument[2]
|
||||
if (afterArgument) {
|
||||
rightRange.end.column =
|
||||
rightRange.start.column +
|
||||
argumentRightOfCursor.length +
|
||||
1
|
||||
}
|
||||
editor.session.remove(rightRange)
|
||||
}
|
||||
}
|
||||
}
|
||||
// finally, insert the match
|
||||
|
|
Loading…
Reference in a new issue