t9md / atom-vim-mode-plus

vim-mode improved
https://atom.io/packages/vim-mode-plus
MIT License
1.4k stars 111 forks source link

[Bug] duplicate-with-comment-out-original in Normal mode #1129

Closed nwaywood closed 4 years ago

nwaywood commented 4 years ago

duplicate-with-comment-out-original doesn't seem to be working as expected.

In my keymap.cson I have:

'atom-text-editor.vim-mode-plus:not(.insert-mode)':
    'g D': 'vim-mode-plus:duplicate-with-comment-out-original'

when I execute this from visual mode on a single line, V g D it works as expected and results in the following:

image

However the equivalent in normal mode, g D i l, produces the following:

image

It seems that when executed from normal mode, a newline character is not being inserted

Expected behavior

g D i l or g D a l should produce the same result as V g D (the first image above)

Actual behavior

V g D produces the first image above but g D i l produces the second image above

I hope this makes sense, let me know if you need more info.

I am running latest stable Atom and latest vim-mode-plus on MacOS 10.14.6

nwaywood commented 4 years ago

Nevermind, just after posting this I realised I just needed to add an operator-pending-mode binding!

'atom-text-editor.vim-mode-plus.operator-pending-mode.duplicate-with-comment-out-original-pending':
  'D': 'vim-mode-plus:duplicate-with-comment-out-original'

Sorry to bother you!