mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #4079 from overleaf/ae-ace-replace-range-symbol
Replace all selected ranges when inserting symbol into source editor GitOrigin-RevId: bc0d7548f61fd740a87b34bb181516e8dc21fff1
This commit is contained in:
parent
6dc7f662aa
commit
823960f763
1 changed files with 5 additions and 1 deletions
|
@ -135,7 +135,11 @@ App.directive(
|
|||
|
||||
ide.$scope.$on('editor:replace-selection', (event, text) => {
|
||||
editor.focus()
|
||||
editor.insert(text)
|
||||
const document = editor.session.getDocument()
|
||||
const ranges = editor.selection.getAllRanges()
|
||||
for (const range of ranges) {
|
||||
document.replace(range, text)
|
||||
}
|
||||
})
|
||||
|
||||
scope.$watch('autoPairDelimiters', autoPairDelimiters => {
|
||||
|
|
Loading…
Reference in a new issue