Skip to content

Commit 0fa99b1

Browse files
committed
Changed 'selection' to 'onlySelected'.
Signed-off-by: ubi de feo <[email protected]>
1 parent 9908d4a commit 0fa99b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ui/arduino/store.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,15 +205,15 @@ async function store(state, emitter) {
205205
})
206206

207207
// CODE EXECUTION
208-
emitter.on('run', async (selection = false) => {
208+
emitter.on('run', async (onlySelected = false) => {
209209
log('run')
210210
const openFile = state.openFiles.find(f => f.id == state.editingFile)
211211
let code = openFile.editor.editor.state.doc.toString()
212212

213213
// If there is a selection, run only the selected code
214214
const startIndex = openFile.editor.editor.state.selection.ranges[0].from
215215
const endIndex = openFile.editor.editor.state.selection.ranges[0].to
216-
if (endIndex - startIndex > 0 && selection) {
216+
if (endIndex - startIndex > 0 && onlySelected) {
217217
selectedCode = openFile.editor.editor.state.doc.toString().substring(startIndex, endIndex)
218218
// Checking to see if the user accidentally double-clicked some whitespace
219219
// While a random selection would yield an error when executed,

0 commit comments

Comments
 (0)