Skip to content

Commit b441f14

Browse files
committed
Add a -None- option for the programmer
Addresses #39 in an alternate way. When set to None, no programmer will be passed to the CLI. This will upload directly to the Arduino bootloader.
1 parent 8c86ff3 commit b441f14

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

autoload/arduino.vim

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,10 @@ function! arduino#GetBoardOptions(board) abort
346346
endfunction
347347

348348
function! arduino#GetProgrammers() abort
349-
let programmers = []
349+
let programmers = [{
350+
\ 'label': '-None-',
351+
\ 'value': '',
352+
\}]
350353
if g:arduino_use_cli
351354
let data = s:get_json_output('arduino-cli board details ' . g:arduino_board . ' --list-programmers --format json')
352355
if has_key(data, 'programmers')
@@ -565,7 +568,7 @@ endfunction
565568

566569
function! arduino#GetSerialCmd() abort
567570
let port = arduino#GetPort()
568-
if empty(port)
571+
if !port
569572
echoerr "Error! No serial port found"
570573
return ''
571574
endif

lua/arduino/telescope.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ local M = {}
99
local entry_maker = function(item)
1010
return {
1111
display = item.label or item.value,
12-
ordinal = item.value,
12+
ordinal = item.label or item.value,
1313
value = item.value,
1414
}
1515
end

0 commit comments

Comments
 (0)