t9md / atom-vim-mode-plus

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

Escape with multiple cursor selections broken #1151

Closed bennypowers closed 3 years ago

bennypowers commented 3 years ago

1150 broke a common workflow of mine:

Source

Given this source text:

<a aria-label="GitLab" target="_blank" rel="noreferrer nofollow" tabindex="-1" href="https://gitlab.com/bennyp">
  <sl-icon-button icon="gitlab-icon-mono">
    <svg><use xlink:href="#gitlab-icon-mono"/></svg>
  </sl-icon-button>
</a>

<a aria-label="GitHub" target="_blank" rel="noreferrer nofollow" tabindex="-1" href="https://github.com/bennypowers">
  <sl-icon-button>
    <svg><use xlink:href="#github-icon-mono"/></svg>
  </sl-icon-button>
</a>

Steps to Reproduce

Perform these steps:

  1. move to s in first occurrence of <sl-icon-button>
  2. v (enter VISUAL mode)
  3. e e e (sl-icon is selected)
  4. cmd-d cmd-d cmd-d cmd-d (four instances of sl-icon are highlighted via multiple cursors)
  5. escape to NORMAL mode (multiple cursors are on the n in sl-icon) BROKEN
  6. perform an operation e.g. d i w backspace to change all instances from <sl-icon-button> to <sl-button>

Expected

Multiple cursors on first n in four instances of <sl-icon-button>

Actual

This commit broke step 5 - instead of cursor staying on the n in each instance, multiple cursors collapse to only the original instance.

Workaround

add the following to the bottom of keymap.cson:

'atom-text-editor.vim-mode-plus':
  'escape': 'vim-mode-plus:reset-normal-mode'

'atom-text-editor.vim-mode-plus:not(.normal-mode)':
  'escape': 'vim-mode-plus:activate-normal-mode'
debug info ```json { "atom": "1.57.0", "platform": "darwin", "release": "18.7.0", "vmpVersion": "1.36.5", "vmpConfig": { "askOptInToEditorScrollPastEnd": false, "automaticallyEscapeInsertModeOnActivePaneItemChange": true, "charactersToAddSpaceOnSurround": [ "{" ], "hideCommandsFromCommandPalette": true, "keymapBackslashToInnerCommentOrParagraphWhenToggleLineCommentsIsPending": true, "keymapCCToChangeInnerSmartWord": true, "keymapPToPutWithAutoIndent": true, "keymapSemicolonToConfirmOnFindInput": true, "keymapSemicolonToInnerAnyPairInOperatorPendingMode": true, "showHoverSearchCounter": true, "smoothScrollOnFullScrollMotion": true, "statusBarModeStringStyle": "long", "useSmartcaseForSearch": true, "useSmartcaseForSearchCurrentWord": true, "wrapLeftRightMotion": true } } ```

Read and check all "Checklist" below.

Checklist

You have to check all before open issue.

t9md commented 3 years ago

Thank you for reporting. I reverted and released 1.36.6.