autolist.nvim icon indicating copy to clipboard operation
autolist.nvim copied to clipboard

autolist.new and autolist.new_before behave weirdly if mapped to anything other than o/O (normal mode)

Open Aicaya opened this issue 2 years ago • 7 comments

For context, I do not use a querty layout and have heavily remapped everything for comfort, so now 'h' and 'H' are mapped to 'o' and 'O' respectively. However, using autolist.create_mapping_hook('n', 'h', autolist.new) and autolist.create_mapping_hook('n', 'H', autolist.new_before) results in the h/H keys not doing anything on most situations. The only time they do anything is when the cursor is inside a list: If it's the first item, it does the same as using the 'a' key; but if it's in the second-or-greater item it does the same as in #20 but without the newline.

The same happens when using any key that wasn't remapped on my layout, except with those they at least do their intended functions outside of lists ('q' starts recording, 'w' moves to the next word, etc.); and that just makes the behavior even weirder since if the command defaults to using the key's intended function, I would expect it to either insert newlines or (if coded to use neovim's defaults for some reason) move the cursor to the left -- neither of which occur.

This was all tested with every other plugin removed from the config as well, so no conflicts are involved.

Would it be possible to make the two functions behave more like bullets.vim, where '<Plug>(bullets-newline)' handles newlines in general instead of defaulting to the keys' previous behavior? I can't just switch to either 'o' or 'O' since they're currently mapped to ':' and ';' for ergonomic reasons.

Aicaya avatar Jun 25 '23 16:06 Aicaya