Open VimWei opened 6 months ago
FWIW, o
appears to work correctly without the custom mapping - it inserts a new line below, adds the correct bullet / number, and enters insert mode..
Ignore this
After update RIME/weasel from 0.15 to 0.16 : https://github.com/rime/weasel/releases/tag/0.16.0
There have been some changes in the results:
o
can add bullets-newline and trigger vim-im-select properly.O
with the following definition fails to trigger vim-im-select: function! SmartBulletsNewlineAbove()
let l:save_cursor = getcurpos()
let l:current_line_num = l:save_cursor[1]
execute "normal! \<Plug>(bullets-newline)"
if line('.') > l:current_line_num
execute line('.') . 'move ' . (l:current_line_num - 1)
endif
execute "normal! \<Plug>(bullets-renumber)"
call setpos('.', [0, l:current_line_num, 0, 0])
call feedkeys('A', 'i')
endfunction
let g:bullets_custom_mappings = [ ['nmap', 'O', ':call SmartBulletsNewlineAbove()<CR>']]
It seems that the issue lies with the line: execute "normal! \<Plug>(bullets-newline)"
Hoping that Bullets.vim can provide an official <Plug>(bullets-newline-above)
for better compatibility with other plugins.
brglng/vim-im-select is dedicated to automatically toggling the state of input methods, significantly improving the experience for users working with non-English input methods.
But bullets-vim conflicts with brglng/vim-im-select:
o
can add bullets-newline but fails to trigger vim's InsertEnter and InsertLeave events. but this trigger is required by vim-im-select.