Skip to content

Commit 3fcc552

Browse files
committed
cider: use get() and extend() for better vim-scriptiness
Manually iterating through the items and adding them to the dictionary is unnecessary as the extend() functions exists to extend a dictionary with the items of another dictionary.
1 parent e23fe79 commit 3fcc552

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

plugin/cider.vim

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,10 @@ function! s:clean_ns() abort
136136
call setpos("']", [0, line2, col2, 0])
137137

138138
if expand('<cword>') ==? 'ns'
139-
let opts = { 'op': 'clean-ns', 'path': p }
139+
let opts = { 'op': 'clean-ns', 'path': p }
140+
call extend(opts, get(g:, 'refactor_nrepl_options', {}))
140141

141-
if exists('g:refactor_nrepl_options')
142-
for [opt_k, opt_v] in items(g:refactor_nrepl_options)
143-
let opts[opt_k] = opt_v
144-
endfor
145-
endif
146-
147-
let res = fireplace#message(opts)[0]
142+
let res = fireplace#message(opts)[0]
148143
let error = get(res, 'error')
149144
if !empty(error)
150145
throw error

0 commit comments

Comments
 (0)