Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: i_<C-o>gcc inserts g@$ #204

Merged
merged 1 commit into from Aug 15, 2022
Merged

fix!: i_<C-o>gcc inserts g@$ #204

merged 1 commit into from Aug 15, 2022

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@$
1 participant