ClosestStorm / macvim

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

Toggle casing is reverted for the character below cursor #435

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
MacVim 7.3 (66), OsX 10.8.2

Do a selection in VISIBLE-mode and press '~'. Characters case are inverted, but 
upon exiting the command, the character below the cursor switches back to it's 
original state.

The issue is not with vim or my configurations.

Original issue reported on code.google.com by hkj...@me.com on 17 Dec 2012 at 9:29

GoogleCodeExporter commented 9 years ago
I cannot reproduce.  It does sound like a configuration issue despite your 
assertion otherwise.  Have you gone through the troubleshooting guide?

Original comment by bjorn.winckler@gmail.com on 9 Jun 2013 at 2:07

GoogleCodeExporter commented 9 years ago
I have. I started without any configurations and the issue still persists.
I found that using "<leader>u" worked, so it's not much of a problem.
Also, usually there are some whitespace that I can include in the selection,
so that it tries to toggle whitespace basically.
As I said, this is not a problem with vim, and I do not really see much reasons
to stick with macvim either, now that the terminal has quite good color-support.

Original comment by hkj...@me.com on 9 Jun 2013 at 6:48

GoogleCodeExporter commented 9 years ago
Can you give me minimal step-by-step instructions on how to reproduce the 
problem?

Original comment by bjorn.winckler@gmail.com on 9 Jun 2013 at 7:05

GoogleCodeExporter commented 9 years ago
Select a word that is all lowercase in visual-mode, press '~' and then 'b'.
The first character ends up shifting back.

Original comment by hkj...@me.com on 9 Jun 2013 at 8:28

GoogleCodeExporter commented 9 years ago
I still can't reproduce, but a thought struck me: what keyboard layout are you 
using?  If '~' is a dead key on your keyboard then this could explain what you 
are seeing.

Original comment by bjorn.winckler@gmail.com on 10 Jun 2013 at 5:57

GoogleCodeExporter commented 9 years ago
Norwegian. I do get a tilde in insert-mode though. Not sure if I understand 
what you mean about dead key.

Original comment by hkj...@me.com on 10 Jun 2013 at 7:24

GoogleCodeExporter commented 9 years ago
I can confirm that it is a dead key issue.

A "dead key" is one that doesn't immediately generate a keyboard event when it 
is pressed, instead it typically waits for the next key press before anything 
happens.  So pressing '~' then 'n' turns into ñ on a Norwegian keyboard.

This is tricky to handle and there are other related issues that I am aware of 
but I'll see if I get a chance to look into it sometime.

Original comment by bjorn.winckler@gmail.com on 10 Jun 2013 at 12:52

GoogleCodeExporter commented 9 years ago
Issue 446 has been merged into this issue.

Original comment by bjorn.winckler@gmail.com on 10 Jun 2013 at 12:52

GoogleCodeExporter commented 9 years ago
One workaround to this issue is to go into the Advanced Preferences and disable 
"Draw marked text inline".  However, since "~" is a dead key you have to press 
another key before the case is toggled.  Far from ideal, but it works.

Alternatively, you can have MacVim automatically toggle between an English 
layout in normal mode, and Norwegian layout in insert mode.  This is 
accomplished by choosing an English layout (while in normal mode), typing ":set 
noimd", entering insert mode and choosing Norwegian layout.  Now, when you exit 
insert mode MacVim switches to the English layout and when you go back to 
insert mode it toggles to Norwegian again.

See ":h macvim-international" for more info.

Original comment by bjorn.winckler@gmail.com on 12 Jun 2013 at 9:04