@@ -16,11 +16,11 @@ export function wrapTextWith (editor, cm, symbol) {
1616 let headIndex = editor . indexFromPos ( ranges [ i ] . head )
1717 cm . replaceRange ( symbol + selection + symbol , from , to , '+input' )
1818 if ( anchorIndex > headIndex ) {
19- ranges [ i ] . anchor . ch += symbol . length
20- ranges [ i ] . head . ch += symbol . length
19+ ranges [ i ] . anchor . ch += symbol . length
20+ ranges [ i ] . head . ch += symbol . length
2121 } else {
22- ranges [ i ] . head . ch += symbol . length
23- ranges [ i ] . anchor . ch += symbol . length
22+ ranges [ i ] . head . ch += symbol . length
23+ ranges [ i ] . anchor . ch += symbol . length
2424 }
2525 cm . setSelections ( ranges )
2626 } else {
@@ -54,7 +54,7 @@ export function insertText (cm, text, cursorEnd = 0) {
5454 cm . setCursor ( { line : cursor . line , ch : cursor . ch + cursorEnd } )
5555}
5656
57- export function insertLink ( cm , isImage ) {
57+ export function insertLink ( cm , isImage ) {
5858 let cursor = cm . getCursor ( )
5959 let ranges = cm . listSelections ( )
6060 const linkEnd = '](https://)'
@@ -71,16 +71,16 @@ export function insertLink(cm, isImage) {
7171 selection = symbol + selection + linkEnd
7272 cm . replaceRange ( selection , from , to )
7373 if ( anchorIndex > headIndex ) {
74- ranges [ i ] . anchor . ch += symbol . length
75- ranges [ i ] . head . ch += symbol . length
74+ ranges [ i ] . anchor . ch += symbol . length
75+ ranges [ i ] . head . ch += symbol . length
7676 } else {
77- ranges [ i ] . head . ch += symbol . length
78- ranges [ i ] . anchor . ch += symbol . length
77+ ranges [ i ] . head . ch += symbol . length
78+ ranges [ i ] . anchor . ch += symbol . length
7979 }
8080 cm . setSelections ( ranges )
8181 } else {
8282 cm . replaceRange ( symbol + linkEnd , cursor , cursor )
83- cm . setCursor ( { line : cursor . line , ch : cursor . ch + symbol . length + linkend . length } )
83+ cm . setCursor ( { line : cursor . line , ch : cursor . ch + symbol . length + linkEnd . length } )
8484 }
8585 }
8686 cm . focus ( )
0 commit comments