Skip to content
This repository was archived by the owner on Feb 23, 2025. It is now read-only.

Commit bc381c6

Browse files
authored
Merge pull request #444 from liquidz/dev
Next release
2 parents 695382d + d961443 commit bc381c6

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

CHANGELOG.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
All notable changes to this project will be documented in this file. This change log follows the conventions of http://keepachangelog.com/[keepachangelog.com].
22

33
== Unreleased (dev)
4+
// {{{
5+
=== Fixed
6+
* https://github.com/liquidz/vim-iced/issues/443[#443]: Fixed evaluation spinners not to remain when codes are evaluated with `<Plug>(iced_eval)`.
7+
// }}}
48

59
== 3.12.3148 (2022-09-10)
610
// {{{

autoload/iced/nrepl/eval.vim

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ function! s:line_uniq_key() abort
9696
return printf('%d-%d', bufnr('%'), line('.'))
9797
endfunction
9898

99-
function! iced#nrepl#eval#out(resp, ...) abort
100-
let opt = get(a:, 1, {})
99+
function! iced#nrepl#eval#out(resp) abort
100+
let opt = get(a:resp, 'iced_out_opt', {})
101101

102102
let spinner_key = get(opt, 'spinner_key', '')
103103
if ! empty(spinner_key)
@@ -115,7 +115,7 @@ function! iced#nrepl#eval#out(resp, ...) abort
115115

116116
" Ignoring session validity means that this evaluation does not related to current buffer.
117117
" Thus the evaluation result does not related to current cursor position.
118-
if ! get(opt, 'ignore_session_validity', v:false)
118+
if ! get(opt, 'ignore_session_validity', v:false)
119119
let virtual_text_opt = copy(get(opt, 'virtual_text', {}))
120120
let virtual_text_opt['highlight'] = g:iced#eval#popup_highlight
121121
let virtual_text_opt['buffer'] = get(opt, 'buffer', bufnr('%'))
@@ -188,7 +188,7 @@ function! iced#nrepl#eval#code(code, ...) abort
188188
let out_opt['line'] = line('.')
189189
let out_opt['spinner_key'] = spinner_key
190190

191-
let Callback = get(opt, 'callback', {resp -> iced#nrepl#eval#out(resp, out_opt)})
191+
let Callback = get(opt, 'callback', function('iced#nrepl#eval#out'))
192192
if has_key(opt, 'callback')
193193
unlet opt['callback']
194194
endif
@@ -212,6 +212,7 @@ function! iced#nrepl#eval#code(code, ...) abort
212212
\ })
213213
endif
214214
return iced#promise#call('iced#nrepl#eval', [code, opt])
215+
\.then({resp -> iced#util#assoc(resp, 'iced_out_opt', out_opt)})
215216
\.then(Callback)
216217
finally
217218
let @@ = reg_save

autoload/iced/util.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ function! iced#util#partition(arr, n, is_all) abort
140140
return result
141141
endfunction
142142

143+
function! iced#util#assoc(dict, k, v) abort
144+
let d = copy(a:dict)
145+
let d[a:k] = a:v
146+
return d
147+
endfunction
148+
143149
function! iced#util#save_var(v, filename) abort
144150
let serialized = string(a:v)
145151
call writefile([serialized], a:filename)

0 commit comments

Comments
 (0)