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

Resolves #62 - Change the way visual mode is restored after a command #65

Merged
merged 2 commits into from
Sep 2, 2018

Conversation

SidOfc
Copy link
Owner

@SidOfc SidOfc commented Sep 2, 2018

This patch fixes #62. (And also mapping bug: #64)

Prior to this change, the setting g:mkdx#settings.restore_visual could not be changed at runtime, one had to restart Vim due to the way that visual mode was restored (applying gv after plug mapping).

To fix this extra <Plug> mappings were added and some existing ones were changed. Backwards compatibility is kept by keeping a copy of the original <Plug> mappings around, so they will still work if you created a custom mapping with them, just note that in visual mode, the selection will no longer be restored.

This is the list of plugs that are deprecated:

" backwards compat <= 1.8.0
noremap         <silent> <Plug>(mkdx-checkbox-next)      :call      mkdx#ToggleCheckboxState()<Cr>
noremap         <silent> <Plug>(mkdx-checkbox-prev)      :call      mkdx#ToggleCheckboxState(1)<Cr>
noremap         <silent> <Plug>(mkdx-toggle-quote)       :call      mkdx#ToggleQuote()<Cr>
noremap         <silent> <Plug>(mkdx-toggle-checkbox)    :call      mkdx#ToggleCheckboxTask()<Cr>
noremap         <silent> <Plug>(mkdx-toggle-checklist)   :call      mkdx#ToggleChecklist()<Cr>
noremap         <silent> <Plug>(mkdx-toggle-list)        :call      mkdx#ToggleList()<Cr>

And here a list of what replaced what:

  • <Plug>(mkdx-checkbox-next) replaced by
    • <Plug>(mkdx-checkbox-next-n)
    • <Plug>(mkdx-checkbox-next-v)
  • <Plug>(mkdx-checkbox-prev) replaced by
    • <Plug>(mkdx-checkbox-prev-n)
    • <Plug>(mkdx-checkbox-prev-v)
  • <Plug>(mkdx-toggle-quote) replaced by
    • <Plug>(mkdx-toggle-quote-n)
    • <Plug>(mkdx-toggle-quote-v)
  • <Plug>(mkdx-toggle-checkbox) replaced by
    • <Plug>(mkdx-toggle-checkbox-n)
    • <Plug>(mkdx-toggle-checkbox-v)
  • <Plug>(mkdx-toggle-checklist) replaced by
    • <Plug>(mkdx-toggle-checklist-n)
    • <Plug>(mkdx-toggle-checklist-v)
  • <Plug>(mkdx-toggle-list) replaced by
    • <Plug>(mkdx-toggle-list-n)
    • <Plug>(mkdx-toggle-list-v)

All the docs have been updated to reflect the new -{n|v} style for these plugs.

@SidOfc SidOfc added the bug:fix Submitting patches for existing functionality. label Sep 2, 2018
@SidOfc SidOfc added this to the v1.8.1 milestone Sep 2, 2018
@SidOfc SidOfc self-assigned this Sep 2, 2018
@SidOfc SidOfc merged commit 8153db0 into master Sep 2, 2018
@SidOfc SidOfc deleted the feature/replace-gv-in-plugs branch September 3, 2018 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:fix Submitting patches for existing functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move gv switches from end of mappings to functions
1 participant