t9md / atom-vim-mode-plus

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

Conflict with spell-check #772

Open nyorain opened 7 years ago

nyorain commented 7 years ago

Version:

Atom    : 1.16.0
Electron: 1.4.16
Chrome  : 53.0.2785.143
Node    : 6.5.0

I'm running Arch Linux and the latest version of vim-mode-plus and spell-check. This may also be a bug in the atom spell-check package, but I guessed it is probably something in vim-mode-plus.

When using vim-mode-plus and trying to correct a word using spell-check (via ctrl+shift+;) the correction popup behaves weirdly (I had no problems with vim-mode-plus disabled):

To sum it up, vim-mode-plus seems to override the behavior of spell-check. I guess the correct behavior would be to always make escape close the popup and enable arrow key navigation and the search box even in normal mode.

Btw: thanks for your great work, am using the plugin without problems for more than a year now :+1:

t9md commented 7 years ago

Thanks for reporting. I agree with you. I want vmp not breaking other package's behavior.

But after investigated, there is no easy fix for this. Atom's keymap is propagated to upper DOM node in similar way of browser event. The spell-check mini-editor is attached to child DOM node of normal editor via overlay decoration.

Like this.

To prevent unwanted keystroke match on spell-chek popup paste following on your keymap.cson I cannot decide this to be set by vim-mode-plus's default keymap( maybe I should but need more thinking time ).

'.corrections atom-text-editor[mini]':
  'enter': 'core:confirm'
  'tab': 'core:confirm'
  'up': 'core:move-up'
  'down': 'core:move-down'
  'space': 'abort!'
  'ctrl-f': 'core:move-right'
  '!': 'abort!'
  '"': 'abort!'
  '#': 'abort!'
  '$': 'abort!'
  '%': 'abort!'
  '&': 'abort!'
  '\'': 'abort!'
  '(': 'abort!'
  ')': 'abort!'
  '*': 'abort!'
  '+': 'abort!'
  ',': 'abort!'
  '-': 'abort!'
  '.': 'abort!'
  '/': 'abort!'
  '0': 'abort!'
  '1': 'abort!'
  '2': 'abort!'
  '3': 'abort!'
  '4': 'abort!'
  '5': 'abort!'
  '6': 'abort!'
  '7': 'abort!'
  '8': 'abort!'
  '9': 'abort!'
  ':': 'abort!'
  ';': 'abort!'
  '<': 'abort!'
  '=': 'abort!'
  '>': 'abort!'
  '?': 'abort!'
  '@': 'abort!'
  'A': 'abort!'
  'B': 'abort!'
  'C': 'abort!'
  'D': 'abort!'
  'E': 'abort!'
  'F': 'abort!'
  'G': 'abort!'
  'H': 'abort!'
  'I': 'abort!'
  'J': 'abort!'
  'K': 'abort!'
  'L': 'abort!'
  'M': 'abort!'
  'N': 'abort!'
  'O': 'abort!'
  'P': 'abort!'
  'Q': 'abort!'
  'R': 'abort!'
  'S': 'abort!'
  'T': 'abort!'
  'U': 'abort!'
  'V': 'abort!'
  'W': 'abort!'
  'X': 'abort!'
  'Y': 'abort!'
  'Z': 'abort!'
  '[': 'abort!'
  '\\': 'abort!'
  ']': 'abort!'
  '^': 'abort!'
  '_': 'abort!'
  '`': 'abort!'
  'a': 'abort!'
  'b': 'abort!'
  'c': 'abort!'
  'd': 'abort!'
  'e': 'abort!'
  'f': 'abort!'
  'g': 'abort!'
  'h': 'abort!'
  'i': 'abort!'
  'j': 'abort!'
  'k': 'abort!'
  'l': 'abort!'
  'm': 'abort!'
  'n': 'abort!'
  'o': 'abort!'
  'p': 'abort!'
  'q': 'abort!'
  'r': 'abort!'
  's': 'abort!'
  't': 'abort!'
  'u': 'abort!'
  'v': 'abort!'
  'w': 'abort!'
  'x': 'abort!'
  'y': 'abort!'
  'z': 'abort!'
  '{': 'abort!'
  '|': 'abort!'
  '}': 'abort!'
  '~': 'abort!'
t9md commented 7 years ago

Ideally I want atom-keymap system support passthrough feature when defining commands.

nyorain commented 7 years ago

Thanks, the keymap additions you posted works so far! I don't know too much about the whole DOM and key propagation thing, so I guess I will simply stick with changing the keymap.

But the most annoying break was (for me) that the correction overlay could no longer be closed using escape which can be fixed by adding: 'escape': 'core:cancel', just in case anybody else uses this or you decide to set the keymap.