neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit c61af03cd2c310c1ee472b4529c34f6656574770
parent 7dfd466437d506d800c7db12cc8a111357e13aff
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Wed,  7 Dec 2022 14:11:26 +0800

vim-patch:0e6adf8a29d5

Update runtime files

https://github.com/vim/vim/commit/0e6adf8a29d5c2c96c42cc7157f71bf22c2ad471

Co-authored-by: Bram Moolenaar <Bram@vim.org>

Diffstat:
Mruntime/doc/map.txt | 21++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt @@ -872,28 +872,35 @@ Here is an example that counts the number of spaces with <F4>: > " doubling <F4> works on a line nnoremap <expr> <F4><F4> CountSpaces() .. '_' - function CountSpaces(type = '') abort + function CountSpaces(virtualedit = '', irregular_block = v:false, type = '') abort if a:type == '' - set opfunc=CountSpaces + let &operatorfunc = function('CountSpaces', [&virtualedit, v:false]) + set virtualedit=block return 'g@' endif + let cb_save = &clipboard let sel_save = &selection let reg_save = getreginfo('"') - let cb_save = &clipboard let visual_marks_save = [getpos("'<"), getpos("'>")] try - set clipboard= selection=inclusive - let commands = #{line: "'[V']y", char: "`[v`]y", block: "`[\<c-v>`]y"} - silent exe 'noautocmd keepjumps normal! ' .. get(commands, a:type, '') - echom count(getreg('"'), ' ') + set clipboard= selection=inclusive virtualedit= + let commands = #{line: "'[V']", char: "`[v`]", block: "`[\<C-V>`]"}->get(a:type, 'v') + if getpos("']")[-1] != 0 || a:irregular_block + let commands ..= 'oO$' + let &operatorfunc = function('CountSpaces', [a:virtualedit, v:true]) + endif + let commands ..= 'y' + execute 'silent noautocmd keepjumps normal! ' .. commands + echomsg getreg('"')->count(' ') finally call setreg('"', reg_save) call setpos("'<", visual_marks_save[0]) call setpos("'>", visual_marks_save[1]) let &clipboard = cb_save let &selection = sel_save + let &virtualedit = a:virtualedit endtry endfunction