Skip to content

Commit

Permalink
Merge pull request #427 from liquidz/dev
Browse files Browse the repository at this point in the history
3.10.2
  • Loading branch information
liquidz authored Aug 1, 2022
2 parents d0c2d50 + 638f5b0 commit 8918e5b
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 36 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file. This change

== Unreleased (dev)

== 3.10.2 (2022-08-02)
// {{{
=== Changed
* Bumped refactor-nrepl to 3.5.4.

=== Fixed
* https://github.com/liquidz/vim-iced/issues/425[#425]: Reverted https://github.com/liquidz/vim-iced/issues/423[#423] for now.
* Fixed not to append stdout buffer's delimiters after disabling.
// }}}

== 3.10.1 (2022-07-29)
// {{{
=== Changed
Expand Down
4 changes: 3 additions & 1 deletion autoload/iced/buffer/stdout.vim
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ function! iced#buffer#stdout#append(s) abort
call timer.start_lazily(
\ 'append_delimiter',
\ g:iced#buffer#stdout#delimiter_delay,
\ {-> iced#buffer#stdout#append(g:iced#buffer#stdout#delimiter_line)},
\ {-> (g:iced#buffer#stdout#enable_delimiter)
\ ? iced#buffer#stdout#append(g:iced#buffer#stdout#delimiter_line)
\ : ''},
\ )
endif

Expand Down
18 changes: 13 additions & 5 deletions autoload/iced/paredit.vim
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,21 @@ function! iced#paredit#get_top_list_in_comment() abort
let view = winsaveview()
let curpos = getpos('.')

" NOTE: `sexp#select_current_top_list` cannot correctly select codes
" including reader conditionals like below
" > #?(:clj :foo
" > :cljs :bar)
call s:select_current_top_list()
" First use vim-sexp optimized top form selector
call sexp#select_current_top_list('v', 0)
let top_code = get(s:get_visual_selection_and_pos(), 'code', '')

" FIXME: s:select_current_top_list could not select the following form correctly
" > (defn foo []
" > ;; \"bar\")
" > \"bar\")
" " NOTE: `sexp#select_current_top_list` cannot correctly select codes
" " including reader conditionals like below
" " > #?(:clj :foo
" " > :cljs :bar)
" call s:select_current_top_list()
" let top_code = get(s:get_visual_selection_and_pos(), 'code', '')

if (stridx(top_code, '(comment') == 0)
" Select up one by one if the top list is a (comment ...) form
execute "normal! \<Esc>"
Expand Down
2 changes: 1 addition & 1 deletion bin/iced
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SCRIPT_DIR=$(cd $(dirname $0); pwd)
PROJECT_DIR=$(cd $SCRIPT_DIR; cd ..; pwd)
VERSION=$(grep 'Version: ' ${SCRIPT_DIR}/../doc/vim-iced.txt | cut -d' ' -f2)

BASE_DEPENDENCIES='nrepl/nrepl:0.9.0 refactor-nrepl/refactor-nrepl:3.5.3 cider/cider-nrepl:0.28.5 com.github.liquidz/iced-nrepl:1.2.13'
BASE_DEPENDENCIES='nrepl/nrepl:0.9.0 refactor-nrepl/refactor-nrepl:3.5.4 cider/cider-nrepl:0.28.5 com.github.liquidz/iced-nrepl:1.2.13'
BASE_MIDDLEWARES='cider.nrepl/wrap-classpath cider.nrepl/wrap-clojuredocs cider.nrepl/wrap-complete cider.nrepl/wrap-debug cider.nrepl/wrap-format cider.nrepl/wrap-info cider.nrepl/wrap-macroexpand cider.nrepl/wrap-ns cider.nrepl/wrap-out cider.nrepl/wrap-refresh cider.nrepl/wrap-stacktrace cider.nrepl/wrap-spec cider.nrepl/wrap-test cider.nrepl/wrap-trace cider.nrepl/wrap-undef cider.nrepl/wrap-xref refactor-nrepl.middleware/wrap-refactor iced.nrepl/wrap-iced'

CLJS_DEPENDENCIES='cider/piggieback:0.5.3'
Expand Down
2 changes: 1 addition & 1 deletion deps.edn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{:paths ["clj/repl"]
:deps {nrepl/nrepl {:mvn/version "0.9.0"}
refactor-nrepl/refactor-nrepl {:mvn/version "3.5.3"}
refactor-nrepl/refactor-nrepl {:mvn/version "3.5.4"}
cider/cider-nrepl {:mvn/version "0.28.5"}
com.github.liquidz/iced-nrepl {:mvn/version "1.2.13"}}
:__middlewares__
Expand Down
8 changes: 4 additions & 4 deletions 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.10.1
Version: 3.10.2
Author : Masashi Iizuka <liquidz.uo+vim@gmail.com>
License: MIT LICENSE

Expand Down Expand Up @@ -158,7 +158,7 @@ LEININGEN~
cider.nrepl/wrap-undef
cider.nrepl/wrap-xref
iced.nrepl/wrap-iced]}
:plugins [[refactor-nrepl "3.5.3"]]}}
:plugins [[refactor-nrepl "3.5.4"]]}}
<

*vim-iced-manual-boot*
Expand All @@ -169,7 +169,7 @@ BOOT~
(require (quote boot.repl))
(swap! boot.repl/*default-dependencies* concat
'[[refactor-nrepl "3.5.3"]
'[[refactor-nrepl "3.5.4"]
[cider/cider-nrepl "0.28.5"]
[com.github.liquidz/iced-nrepl "1.2.13"]])
Expand Down Expand Up @@ -199,7 +199,7 @@ SHADOW-CLJS~
shadow-cljs.edn
>
{
:dependencies [[refactor-nrepl "3.5.3"]
:dependencies [[refactor-nrepl "3.5.4"]
[cider/cider-nrepl "0.28.5"]
[com.github.liquidz/iced-nrepl "1.2.13"]]
}
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 = 31001
let g:vim_iced_version = 31002
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
19 changes: 13 additions & 6 deletions test/buffer_stdout.vim
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,21 @@ function! s:suite.append_test() abort
let nr = iced#buffer#stdout#init()['bufnr']
call iced#buffer#stdout#clear()

let init_text_len = len(split(g:iced#buffer#stdout#init_text, '\r\?\n'))
call s:assert.equals(getbufline(nr, init_text_len + 1, '$'), [])
let org_enable_delimiter = g:iced#buffer#stdout#enable_delimiter
let g:iced#buffer#stdout#enable_delimiter = v:false

call iced#buffer#stdout#append("foo\nbar")
call s:assert.equals(getbufline(nr, init_text_len + 1, '$'), ['foo', 'bar'])
try
let init_text_len = len(split(g:iced#buffer#stdout#init_text, '\r\?\n'))
call s:assert.equals(getbufline(nr, init_text_len + 1, '$'), [])

call iced#buffer#stdout#append('baz')
call s:assert.equals(getbufline(nr, init_text_len + 1, '$'), ['foo', 'bar', 'baz'])
call iced#buffer#stdout#append("foo\nbar")
call s:assert.equals(getbufline(nr, init_text_len + 1, '$'), ['foo', 'bar'])

call iced#buffer#stdout#append('baz')
call s:assert.equals(getbufline(nr, init_text_len + 1, '$'), ['foo', 'bar', 'baz'])
finally
let g:iced#buffer#stdout#enable_delimiter = org_enable_delimiter
endtry
endfunction

function! s:suite.append_notify_test() abort
Expand Down
35 changes: 18 additions & 17 deletions test/paredit.vim
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,15 @@ function! s:suite.get_top_list_in_comment_test() abort
call s:assert.equals(res['code'], "(foo\n (bar))")
call s:buf.stop_dummy()

" reader conditionals
call s:buf.start_dummy([
\ '#?(:clj :foo',
\ ' :cljs :bar|)',
\ ])
let res = iced#paredit#get_top_list_in_comment()
call s:assert.equals(res['code'], "#?(:clj :foo\n :cljs :bar)")
call s:buf.stop_dummy()
" FIXME
" " reader conditionals
" call s:buf.start_dummy([
" \ '#?(:clj :foo',
" \ ' :cljs :bar|)',
" \ ])
" let res = iced#paredit#get_top_list_in_comment()
" call s:assert.equals(res['code'], "#?(:clj :foo\n :cljs :bar)")
" call s:buf.stop_dummy()

" whole in comments
call s:buf.start_dummy([
Expand All @@ -294,14 +295,15 @@ function! s:suite.get_top_list_in_comment_test() abort
call s:assert.equals(res['code'], '(foo)')
call s:buf.stop_dummy()

" not a top list
call s:buf.start_dummy([
\ '(foo)',
\ ' (bar|)',
\ ])
let res = iced#paredit#get_top_list_in_comment()
call s:assert.equals(res['code'], '')
call s:buf.stop_dummy()
" FIXME
" " not a top list
" call s:buf.start_dummy([
" \ '(foo)',
" \ ' (bar|)',
" \ ])
" let res = iced#paredit#get_top_list_in_comment()
" call s:assert.equals(res['code'], '')
" call s:buf.stop_dummy()

call s:buf.start_dummy([
\ '(foo)',
Expand All @@ -312,4 +314,3 @@ function! s:suite.get_top_list_in_comment_test() abort
call s:buf.stop_dummy()

endfunction

0 comments on commit 8918e5b

Please sign in to comment.