Skip to content

Conversation

@numToStr
Copy link
Owner

@numToStr numToStr commented Aug 13, 2022

Now g@ is returned from the RHS callback of every operator-mode keybindings i.e., gc[motion], gcc etc.. Instead of using a command we are now using a callback as the RHS and returning g@ from that callback to used as an expression, which will be executed by neovim using { expr = true } option. <Plug> mappings are also covered in this fix.

  • Before
vim.keymap.set('n', 'gc', '<CMD>lua require("Comment.api").call("toggle.linewise")<CR>g@')
  • After
vim.keymap.set('n', 'gc', require("Comment.api").call("toggle.linewise", "g@"), { expr = true })

This PR also changes the .call() method signature, now it returns a function which is used to create keymap RHS


Fixes #143

@numToStr numToStr changed the title change: use g@ with expr = true fix!: i_<C-o>gcc inserts g@$ Aug 15, 2022
@numToStr numToStr marked this pull request as ready for review August 15, 2022 13:16
@numToStr numToStr merged commit 0932d0c into master Aug 15, 2022
@numToStr numToStr deleted the i_C-o branch August 15, 2022 13:19
@numToStr numToStr mentioned this pull request Aug 18, 2022
yuttie added a commit to yuttie/dot-vim that referenced this pull request Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

i_<C-\><C-o>gcc prints g@$

2 participants