edenzik / macvim

Automatically exported from code.google.com/p/macvim
0 stars 0 forks source link

Pressing Cmd+W while in insert mode enters ":q" into the current buffer instead of closing the window #85

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

- Open MacVim
- Press "i" to enter insert mode
- Press Cmd+W

What is the expected output? What do you see instead?

The current window should close (or a confirmation dialog should be presented, 
if the text in the 
buffer has been changed). Instead, the text ":q" (and a newline) are entered 
into the buffer.

What version of the product are you using? On what operating system?

From the "About" dialog: MacVim Version 7.1 (26)

From ":version" : VIM - Vi IMproved 7.1 (2007 May 12, compiled Apr 11 2008 
20:33:28)

Operating System: Mac OS X 10.5.2

Please provide any additional information below.

Original issue reported on code.google.com by BillO...@gmail.com on 8 May 2008 at 6:23

GoogleCodeExporter commented 9 years ago
After additional digging (and helpful prompting from Nico), I've discovered 
that this problem seems to be 
related to an insert-mode mapping for Ctrl+Backslash.

If I create a vimrc with just this one line in it...

   imap <C-\> <Nop>

...then the problem appears. It does the same thing with inoremap, too.

It doesn't seem to matter what the right-hand side of the mapping is (which is 
why I'm using <Nop> for this 
example; my original map did lots of other stuff).

I'm guessing the code that issues the :q sequence when ⌘W is pressed is 
sending a <C-\><C-o> 
beforehand (to temporarily enter command mode without changing the cursor 
position), and this mapping 
interferes with that. I haven't looked at the source, however, so I could be 
completely off-base.

Original comment by BillO...@gmail.com on 8 May 2008 at 7:44

GoogleCodeExporter commented 9 years ago
I'm not sure what can be done about the user remapping <C-\>...see the 
discussion on vim_mac so I'm closing 
this issue (for now).

Original comment by bjorn.winckler@gmail.com on 10 May 2008 at 6:27