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

Commit

Permalink
Merge pull request #422 from liquidz/dev
Browse files Browse the repository at this point in the history
3.10.0
  • Loading branch information
liquidz authored Jul 15, 2022
2 parents e59c560 + 363ce2a commit bdd1768
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 3 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@ All notable changes to this project will be documented in this file. This change

== Unreleased (dev)

== 3.10.0 (2022-07-16)
// {{{
=== Added
* https://github.com/liquidz/vim-iced/issues/421[#421]: Added support for delimiter lines to stdout buffer.
** Added following options for this support.
*** `g:iced#buffer#stdout#enable_delimiter`
*** `g:iced#buffer#stdout#delimiter_delay`
*** `g:iced#buffer#stdout#delimiter_line`

=== Fixed
* Fixed connection for `nbb` to force CLJS session.
// }}}

== 3.9.3 (2022-07-07)
// {{{
=== Changed
Expand Down
12 changes: 12 additions & 0 deletions autoload/iced/buffer/stdout.vim
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ let g:iced#buffer#stdout#file = get(g:, 'iced#buffer#stdout#file', '')
let g:iced#buffer#stdout#file_buffer_size = get(g:, 'iced#buffer#stdout#file_buffer_size', 256)
let g:iced#buffer#stdout#enable_notify = get(g:, 'iced#buffer#stdout#enable_notify', v:true)
let g:iced#buffer#stdout#size = get(g:, 'iced#buffer#stdout#size', v:null)
let g:iced#buffer#stdout#enable_delimiter = get(g:, 'iced#buffer#stdout#enable_delimiter', v:true)
let g:iced#buffer#stdout#delimiter_delay = get(g:, 'iced#buffer#stdout#delimiter_delay', 500)
let g:iced#buffer#stdout#delimiter_line = get(g:, 'iced#buffer#stdout#delimiter_line', printf(";; %s\n", iced#util#char_repeat(10, '-')))

function! s:delete_old_lines() abort
let bufnr = iced#buffer#nr(s:bufname)
Expand Down Expand Up @@ -117,6 +120,15 @@ function! iced#buffer#stdout#append(s) abort
\ funcref('s:delete_old_lines'),
\ )

if g:iced#buffer#stdout#enable_delimiter
\ && a:s !=# g:iced#buffer#stdout#delimiter_line
call timer.start_lazily(
\ 'append_delimiter',
\ g:iced#buffer#stdout#delimiter_delay,
\ {-> iced#buffer#stdout#append(g:iced#buffer#stdout#delimiter_line)},
\ )
endif

if ! iced#buffer#stdout#is_visible()
\ && g:iced#buffer#stdout#enable_notify
silent call iced#system#get('notify').notify(s, {'title': 'Stdout'})
Expand Down
2 changes: 1 addition & 1 deletion autoload/iced/nrepl.vim
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ function! s:status(ch) abort
endfunction

function! s:is_cljs_session(timeout_msec) abort
let resp = iced#promise#sync('iced#nrepl#eval', ["(if (resolve 'js/window') true false)"], a:timeout_msec)
let resp = iced#promise#sync('iced#nrepl#eval', ["(if (resolve 'js/window) true false)"], a:timeout_msec)
let value = get(resp, 'value', 'false')
return (type(value) == v:t_string && value ==# 'true')
endfunction
Expand Down
1 change: 1 addition & 0 deletions autoload/iced/nrepl/connect.vim
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ function! s:try_connecting_to_nbb(port) abort
try
return iced#repl#connect('nrepl', a:port, {
\ 'with_iced_nrepl': v:false,
\ 'initial_session': 'cljs',
\ 'verbose': v:false,
\ })
catch
Expand Down
9 changes: 9 additions & 0 deletions doc/pages/buffer/stdout.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,16 @@ Vim-iced provides the following commands to control it's stdout buffer.

|===

==== Notification

In addition to the stdout buffer, standard output can be displayed on popup notification when stdout buffer is invisible.
If you don't use notification for standard output, see {help_html}#g%3Aiced%23buffer%23stdout%23enable_notify[g:iced#buffer#stdout#enable_notify] option.

See also {help_html}#vim-iced-notification[vim-iced-notification] for more information.

==== Delimiters

It is useful to have a delimited line in the unit of output to limit the range of what you want to see.

See {help_html}#g%3Aiced%23buffer%23stdout%23enable_delimiter[g:iced#buffer#stdout#enable_delimiter] for more information.

26 changes: 25 additions & 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.9.3
Version: 3.10.0
Author : Masashi Iizuka <[email protected]>
License: MIT LICENSE

Expand Down Expand Up @@ -429,6 +429,11 @@ STDOUT BUFFER *vim-iced-stdout-buffer*
If you don't use notification for standard output,
see |g:iced#buffer#stdout#enable_notify| option.

For delimiters:
It is useful to have a delimited line in the unit of output
to limit the range of what you want to see.
See |g:iced#buffer#stdout#enable_delimiter| for more information.

If you show buffer content in another application or display,
|g:iced#buffer#stdout#file| option is available for writing file.

Expand Down Expand Up @@ -2173,6 +2178,25 @@ g:iced#buffer#stdout#size
Otherwise, opened with the half size of the current window.
Default value is `v:null`.

*g:iced#buffer#stdout#enable_delimiter*
g:iced#buffer#stdout#enable_delimiter
If {v:true}, a delimiter line is appended after specified delays.
See followings for delimiter line and delay:
- |g:iced#buffer#stdout#delimiter_delay|
- |g:iced#buffer#stdout#delimiter_line|
Default value is `v:true`.

*g:iced#buffer#stdout#delimiter_delay*
g:iced#buffer#stdout#delimiter_delay
A delay time for |g:iced#buffer#stdout#enable_delimiter|.
Unit is milli sec.
Default value is `500`.

*g:iced#buffer#stdout#delimiter_line*
g:iced#buffer#stdout#delimiter_line
A delimiter line for |g:iced#buffer#stdout#enable_delimiter|.
Default value is `';; ----------'`.

------------------------------------------------------------------------------
FORMATTER *vim-iced-customizing-formatter*

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 = 30903
let g:vim_iced_version = 31000
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 bdd1768

Please sign in to comment.