@@ -51,7 +51,7 @@ export function insertText (cm, text, cursorEnd = 0) {
51
51
let cursor = cm . getCursor ( )
52
52
cm . replaceSelection ( text , cursor , cursor )
53
53
cm . focus ( )
54
- cm . setCursor ( { line : cursor . line , ch : cursor . ch + cursorEnd } )
54
+ cm . setCursor ( { line : cursor . line , ch : cursor . ch + cursorEnd } )
55
55
}
56
56
57
57
export function insertLink ( cm , isImage ) {
@@ -80,16 +80,16 @@ export function insertLink (cm, isImage) {
80
80
cm . setSelections ( ranges )
81
81
} else {
82
82
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 } )
84
84
}
85
85
}
86
86
cm . focus ( )
87
87
}
88
88
89
89
export function insertHeader ( cm ) {
90
90
let cursor = cm . getCursor ( )
91
- let startOfLine = { line : cursor . line , ch : 0 }
92
- let startOfLineText = cm . getRange ( startOfLine , { line : cursor . line , ch : 1 } )
91
+ let startOfLine = { line : cursor . line , ch : 0 }
92
+ let startOfLineText = cm . getRange ( startOfLine , { line : cursor . line , ch : 1 } )
93
93
// See if it is already a header
94
94
if ( startOfLineText === '#' ) {
95
95
cm . replaceRange ( '#' , startOfLine , startOfLine )
@@ -108,14 +108,14 @@ export function insertOnStartOfLines (cm, symbol) {
108
108
if ( ! range . empty ( ) ) {
109
109
const from = range . from ( )
110
110
const to = range . to ( )
111
- let selection = cm . getRange ( { line : from . line , ch : 0 } , to )
111
+ let selection = cm . getRange ( { line : from . line , ch : 0 } , to )
112
112
selection = selection . replace ( / \n / g, '\n' + symbol )
113
113
selection = symbol + selection
114
114
cm . replaceRange ( selection , from , to )
115
115
} else {
116
- cm . replaceRange ( symbol , { line : cursor . line , ch : 0 } , { line : cursor . line , ch : 0 } )
116
+ cm . replaceRange ( symbol , { line : cursor . line , ch : 0 } , { line : cursor . line , ch : 0 } )
117
117
}
118
118
}
119
- cm . setCursor ( { line : cursor . line , ch : cursor . ch + symbol . length } )
119
+ cm . setCursor ( { line : cursor . line , ch : cursor . ch + symbol . length } )
120
120
cm . focus ( )
121
121
}
0 commit comments