Skip to content

Commit

Permalink
Merge pull request #375 from liquidz/dev
Browse files Browse the repository at this point in the history
3.7.2
  • Loading branch information
liquidz authored Dec 17, 2021
2 parents 7ddd855 + f314094 commit 3005526
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ All notable changes to this project will be documented in this file. This change

== Unreleased (dev)

== 3.7.2 (2021-12-18)
// {{{
=== Fixed
* https://github.com/liquidz/vim-iced-coc-source/issues/4[vim-iced-coc-source#4]: Updated to change stdout buffer's buftype lazily.
** coc.nvim https://github.com/neoclide/coc.nvim/blob/master/history.md#2018-08-16[does not work in buffers which buftype is 'nofile'], and to avoid this limitation, change stdout buffer's buftype lazily.
***
* Fixed error handling when extracting a var.
// }}}

== 3.7.1 (2021-12-12)
// {{{
=== Changed
Expand Down
6 changes: 5 additions & 1 deletion autoload/iced/buffer/stdout.vim
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ endfunction
function! s:initialize(bufnr) abort
call setbufvar(a:bufnr, '&bufhidden', 'hide')
call setbufvar(a:bufnr, '&buflisted', 0)
call setbufvar(a:bufnr, '&buftype', 'nofile')
call setbufvar(a:bufnr, '&filetype', 'clojure')
call setbufvar(a:bufnr, '&swapfile', 0)
call setbufvar(a:bufnr, '&wrap', 0)

" HACK: coc.nvim does not work with 'nofile' buftype.
" To avoid the limitation, change buftype lazily.
" FIXME: This is workaround for now.
call iced#system#get('timer').start(250, {_ -> setbufvar(a:bufnr, '&buftype', 'nofile')})

for line in split(g:iced#buffer#stdout#init_text, '\r\?\n')
silent call iced#compat#appendbufline(a:bufnr, '$', line)
endfor
Expand Down
5 changes: 5 additions & 0 deletions autoload/iced/nrepl/var.vim
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function! s:extract_var_name(eval_resp, callback) abort
if !has_key(a:eval_resp, 'value') | return iced#message#error('not_found') | endif

let var = a:eval_resp['value']
let ns = ''
if stridx(var, '#''') == 0
let var = substitute(var, '^#''', '', '')
let i = stridx(var, '/')
Expand All @@ -50,6 +51,10 @@ function! s:extract_var_name(eval_resp, callback) abort
let var = printf('%s/%s', ns, var_name)
endif

if empty(ns)
return iced#message#error('not_found')
endif

call a:callback({
\ 'qualified_var': var,
\ 'ns': ns,
Expand Down
2 changes: 1 addition & 1 deletion doc/vim-iced.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*vim-iced.txt* Clojure interactive development environment for Vim8/Neovim

Version: 3.7.1
Version: 3.7.2
Author : Masashi Iizuka <[email protected]>
License: MIT LICENSE

Expand Down
2 changes: 1 addition & 1 deletion ftplugin/clojure.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ if exists('g:loaded_vim_iced')
finish
endif
let g:loaded_vim_iced = 1
let g:vim_iced_version = 30701
let g:vim_iced_version = 30702
let g:vim_iced_home = expand('<sfile>:p:h:h')
" NOTE: https://github.com/vim/vim/commit/162b71479bd4dcdb3a2ef9198a1444f6f99e6843
" Add functions for defining and placing signs.
Expand Down

0 comments on commit 3005526

Please sign in to comment.