File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -205,15 +205,15 @@ async function store(state, emitter) {
205
205
} )
206
206
207
207
// CODE EXECUTION
208
- emitter . on ( 'run' , async ( selection = false ) => {
208
+ emitter . on ( 'run' , async ( onlySelected = false ) => {
209
209
log ( 'run' )
210
210
const openFile = state . openFiles . find ( f => f . id == state . editingFile )
211
211
let code = openFile . editor . editor . state . doc . toString ( )
212
212
213
213
// If there is a selection, run only the selected code
214
214
const startIndex = openFile . editor . editor . state . selection . ranges [ 0 ] . from
215
215
const endIndex = openFile . editor . editor . state . selection . ranges [ 0 ] . to
216
- if ( endIndex - startIndex > 0 && selection ) {
216
+ if ( endIndex - startIndex > 0 && onlySelected ) {
217
217
selectedCode = openFile . editor . editor . state . doc . toString ( ) . substring ( startIndex , endIndex )
218
218
// Checking to see if the user accidentally double-clicked some whitespace
219
219
// While a random selection would yield an error when executed,
You can’t perform that action at this time.
0 commit comments