File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -41,8 +41,13 @@ export default class ToggleCode extends Plugin {
41
41
}
42
42
43
43
getTokenAtCursor ( editor : CodeMirror . Editor ) {
44
+ // TODO: Use findWordAt instead of getTokenAt?
44
45
let cursor = editor . getCursor ( ) ;
45
46
let token = editor . getTokenAt ( cursor ) ;
47
+
48
+ // let word = editor.findWordAt(cursor);
49
+ // console.log('word', editor.getRange(word.anchor, word.head));
50
+
46
51
if ( token . start > 0 && token . end < editor . getLine ( cursor . line ) . length ) {
47
52
let s = editor . getRange ( { line : cursor . line , ch : token . start - 1 } ,
48
53
{ line : cursor . line , ch : token . end + 1 } ) ;
@@ -99,7 +104,6 @@ export default class ToggleCode extends Plugin {
99
104
100
105
// Set selection to the modified text.
101
106
let ch_diff = replacement . length - selectedText . content . length ;
102
-
103
107
if ( wasSelection ) {
104
108
editor . setSelection (
105
109
selectedText . start ,
You can’t perform that action at this time.
0 commit comments