bullets-vim / bullets.vim

🔫 Bullets.vim is a Vim/NeoVim plugin for automated bullet lists.
https://doriankarter.com
Other
476 stars 36 forks source link

[Bug] Recursive macro doesn't work with bullets.vim loaded #94

Open mawkler opened 3 years ago

mawkler commented 3 years ago

This recursive macro didn't work and after some investigation I found out that removing bullets.vim solves the issue. I have no clue why, but here's how to reproduce it:

  1. Use the following .vimrc/init.vim:

    call plug#begin('~/.vim/bundle')
    Plug 'dkarter/bullets.vim'
    call plug#end()
  2. Create a new file that contains the following line:

    1,2,3,4,5,6
  3. Execute the following commands on that line, which creates a recursive macro in register q: _qqqqqf,a<CR><Esc>@qq, and immediately after that press @q to call the macro.

  4. The file is unchanged. However, without bullets.vim, the file will look like this:

    1,
    2,
    3,
    4,
    5,
    6

Output of :version:

NVIM v0.5.0-dev+1133-g0869cbd55
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -
Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -W
shadow -Wconversion -Wmissing-prototypes -Wvla -fstack-protector-strong -fno-c
ommon -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURC
E -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/ho
me/runner/work/neovim/neovim/build/config -I/home/runner/work/neovim/neovim/sr
c -I/home/runner/work/neovim/neovim/.deps/usr/include -I/usr/include -I/home/r
unner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim
/build/include
Compiled by runner@fv-az49-948

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/share/nvim"

The same error appears in Vim as well.

daviewales commented 1 year ago

I've hit something similar. I don't think recursion is the problem. Rather, bullets.vim seems to remove newlines if they are inserted by a macro.

For example, with the following .vimrc:

call plug#begin('~/.vim/plugged')
Plug 'dkarter/bullets.vim'
call plug#end()

And the following macro defined (note that ^[ is a literal ESC, not the characters ^ and [):

o```^[

If I run the macro on a line of text, I would expect to see:

line of text

But instead I see:

line of text```



If I disable bullets.vim, I get the expected result.
mawkler commented 1 year ago

I've switched to autolist.nvim instead and it works great :)