atom-vim-mode-plus icon indicating copy to clipboard operation
atom-vim-mode-plus copied to clipboard

Backspace key intermittently exits insert mode

Open dklanac opened this issue 6 years ago • 22 comments

Check list

Atom : 1.22.0 Electron: 1.6.15 Chrome : 56.0.2924.87 Node : 7.4.0

Vim Mode Plus v1.19.0 macOS High Sierra 10.13.1 (17B48)

Expected:

  • Backspace key usage while in insert mode deletes the character(s) to the left of the "I" beam cursor
  • Mode remains in insert mode until ESC key is pressed
  • "I" beam does not return to a block cursor

Actual:

  • Vim partially exits insert mode
  • Still permits the backspace key to delete characters to the left of the cursor
  • Cursor becomes a block
  • Attempts to resume typing results in normal mode commands rather than inserting characters

Steps to reproduce: The issue seems to be intermittent and not reliably reproduced. I notice that the problem correlates with the usage of native macOS copy/paste keys or the y/p commands. For some reason, I have to use Atom for at least 30 minutes before I run into the problem.

Temporary Remedy: Exit Atom completely and re-open the project. Backspace behaves correctly again until some arbitrary time within the next hour of coding.

dklanac avatar Nov 14 '17 03:11 dklanac

When issue happening, can you check to which command backspace is mapped? You can observe it by cmd-.

t9md avatar Nov 14 '17 03:11 t9md

2017-12-05 21_37_09 I captured the keystrokes while in Atom, but they appeared as the expected keys (e.g. hit backspace, keystroke mapping is also backspace key).

I logged keystrokes while recording this in screen flow to demonstrate the issue. You'll see me hit "a" to enter insert mode. As soon as I hit the backspace key, you'll see the cursor revert to a block caret yet still permit deletion of the "a" characters I've entered. The strange thing is that I'm not still in full insert mode as I'll be prevented from entering new characters going forward again. If I hit a normal mode key (e.g. "d") then it'll execute the cut command. This appears to be intermittent behavior though in that I often hit "d" and nothing happens at all when I'm in this in-between state.

This issue occurs about once to three times per day. There isn't anything in particular that I'm doing that seems to correlate with it happening.

I'm on Atom 1.22.1 on vmp 1.22.0 with ex-mode 0.18.0.

dklanac avatar Dec 06 '17 02:12 dklanac

Why you don't capture movie with cmd-. enabled. Keychaster.app like keystroke displaying is not what we need to know. I want to know how Atom keymap system dispatch which command against your keystroke, which is shown by cmd-..

What I can tell from your capture is that when you see block-cursor, you are in normal-mode as right bottom of the statusbar indicate(N: normal-mode, I: insert-mode).

This issue occurs about once to three times per day. There isn't anything in particular that I'm doing that seems to correlate with it happening.

I understand this would be really frustrating, I want to fix if I can understand what is happening in your environment.

t9md avatar Dec 06 '17 03:12 t9md

I hear you @t9md. When I encounter it again, I'll turn on the Atom keymap in the footer and will create another video for you. No frustration here. You've put together a pretty kickass plugin that turned me into a vim user finally.

dklanac avatar Dec 06 '17 16:12 dklanac

untitled Here is the issue with the keymap turned on in the footer.

dklanac avatar Dec 07 '17 01:12 dklanac

Hey Im not paid support center. I dont want to spend my time by carefully find information from your tiny fonted movie. Use movie as complement, you need give the info from your movie.

t9md avatar Dec 07 '17 01:12 t9md

By observing GIF by frame by frame(which is really frustrating!), I find where you type backspace and it dispatched to core:backspace and after that, vmp shift to block cursor, but still you are insert-mode(which is minor diff from GIF your 1st GIF).

But I have no idea, keymap dispatching works as expected. Do you have your config and packages list you installed(apm list)?

t9md avatar Dec 07 '17 01:12 t9md

Why you don't capture movie with cmd-. enabled.

Just giving you what you requested previously.

[36mBuilt-in Atom Packages[39m (92) ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] └── [email protected]

[36mCommunity Packages (10)[39m /Users/dklanac/.atom/packages ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] └── [email protected]

dklanac avatar Dec 07 '17 02:12 dklanac

I can't figure out why this happens in your environment. And I'm still not sure if this is really vmp's bug.

I want to wait report from other user for a while. Currently you are only person who report this issue.

t9md avatar Dec 10 '17 09:12 t9md

OK. Thanks for looking into this. One other thing that I considered is my keymap.json. I looked through it and didn't notice conflicts. I use all of the shortcuts quite a bit and haven't noticed any correlation between their use and the appearance of the issue.

I've pasted them here for reference:

'atom-workspace':
  'ctrl-alt-n': 'tree-view:add-file'
  'ctrl-alt-k': 'tree-view:duplicate'
  'ctrl-alt-r': 'tree-view:rename'
  'cmd-d f l':'move-panes:move-right'
  'cmd-d f h':'move-panes:move-left'
  'cmd-d f k':'move-panes:move-up'
  'cmd-d f j':'move-panes:move-down'

'atom-text-editor.vim-mode-plus:not(.insert-mode)':
  'cmd-d h': 'window:focus-pane-on-left'
  'cmd-d l': 'window:focus-pane-on-right'
  'cmd-d k': 'window:focus-pane-above'
  'cmd-d j': 'window:focus-pane-below'
  'e': 'vim-mode-plus:redraw-cursor-line-at-top'

dklanac avatar Dec 11 '17 15:12 dklanac

@t9md I can confirm this is happening in my env as well, only in .scss files *shrug.

Even stranger, it doesn't exit insert mode, it sort of hangs. Additionally, when in visual line selection mode, if I use numbers to select, the highlight isn't working, for example: V3k you would expect to enter visual line mode, then select 3 lines up. All that happens in my case, is the cursor moves 3 lines up, no highlight/selection takes place.

Thankfully all this goes away when I close the file and reopen it.

asilvadesigns avatar Jan 19 '18 14:01 asilvadesigns

I have had the same issue happen, for me only in .js files.. i have disabled all packages except vim-mode-plus and removed all keybindings & configuration. it still did not solve the issue (this was done while atom is running and i did not restart.) Is there anything else I could provide that would help identify the issue?

edit: I did not disable any 'core' packages

edit: restarting atom with my normal configuration and packages enabled made backspace key function return to normal

pm0u avatar Oct 12 '18 20:10 pm0u

This happened to me again after a very short time in a css file. Here is the keymap when pressing backspace while in insert mode. (not working -- end up in insert mode purgatory)

image

this image below is backspace pressed when insert mode has been successfully (true) exited already.

image

I restarted atom, behavior gone. This is backspace pressed inside insert mode. (working properly)

image

this is backspace pressed outside of insert mode.

image

pm0u avatar Oct 16 '18 16:10 pm0u

@t9md I have found a way to reliably reproduce the problem on my computer -- it seems to be related to the move-panes plugin. What would be the most helpful to you? a screencap with keystrokes (cmd-. / ctrl-.)? apm list? a logfile?

pm0u avatar Oct 24 '18 17:10 pm0u

@pm0u That's a good find. I have that plugin installed as well. https://atom.io/packages/move-panes

dklanac avatar Oct 24 '18 17:10 dklanac

@dklanac if you would like to try it yourself in the meantime: i created a dummy folder with two files in it. i open atom in the current directory with atom . i open both files as tabs with the same pane. create a vertical split (empty pane to the side of current files). move one file to the new pane. insert mode should now be broken.

edit: problem happens with a horizontal split/move as well. Doesn't seem to matter if I move the file while inside or outside of insert mode.

pm0u avatar Oct 24 '18 18:10 pm0u

Yep. You're right. I can reproduce it too. I have my own keyboard shortcuts for move panes that I use all of the time without thinking. It's starting to make sense why some days it wouldn't happen at all.

On Wed, Oct 24, 2018 at 2:02 PM Paul [email protected] wrote:

@dklanac https://github.com/dklanac if you would like to try it yourself in the meantime: i created a dummy folder with two files in it. i open atom in the current directory with atom . i open both files as tabs with the same pane. create a vertical split. move one file to the new pane. insert mode should now be broken.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/t9md/atom-vim-mode-plus/issues/963#issuecomment-432766180, or mute the thread https://github.com/notifications/unsubscribe-auth/AAydCKRH6PUHuj6sfVlnZCiqwuXZ8-dCks5uoKsmgaJpZM4Qcu7W .

dklanac avatar Oct 24 '18 18:10 dklanac

So, both of you have this issue because of move-pane package? Though, I think I can track down the cause if I check move-pane, I won't. How about openning issue on move-pane project.

And btw, vmp have move-pane-like feature as you can use it in pure Vim. That is...

  • ctrl-w x
  • ctrl-w H
  • ctrl-w J
  • ctrl-w K
  • ctrl-w L

If you are happy with above features, maybe you can uninstall move-panes.

t9md avatar Oct 25 '18 00:10 t9md

I'll look into the pane features built into vmp, if that works well enough for me then I'll probably stop pursuing this further

pm0u avatar Oct 25 '18 00:10 pm0u

Same here.

On Wed, Oct 24, 2018 at 8:35 PM Paul [email protected] wrote:

I'll look into the pane features built into vmp, if that works well enough for me then I'll probably stop pursuing this further

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/t9md/atom-vim-mode-plus/issues/963#issuecomment-432873479, or mute the thread https://github.com/notifications/unsubscribe-auth/AAydCHhb_6IBN_ksyk0GByWu-5wxP0z4ks5uoQdWgaJpZM4Qcu7W .

dklanac avatar Oct 25 '18 00:10 dklanac

@t9md it seems the bindings you suggested will move all contents of a particular pane to a new pane (all tabs) and switch the contents with the pane that is being moved to (vim-mode-plus:move-pane-to-very-left ie). the functionality of the move-panes extension is to move the current foreground tab to a different pane and add it to the tabs in that pane. Does vmp have this functionality?

edit: it looks like moving tabs between panes is now built into atom, but not bound to anything by default. the relevant keybindings would be:

 'window:move-active-item-to-pane-above'
 'window:move-active-item-to-pane-below'
 'window:move-active-item-to-pane-on-left'
 'window:move-active-item-to-pane-on-right'

side note: thanks for the great plugin, it takes atom from barely usable to my preferred editor!

pm0u avatar Oct 25 '18 04:10 pm0u

Here is my keymap for commands you mentioned.

https://github.com/t9md/dotfiles/blob/0d1a16636aeb2e3a225eb4392370351ddadc5b2a/atom/keymap.cson#L18-L22

t9md avatar Oct 25 '18 09:10 t9md