Closed GoogleCodeExporter closed 9 years ago
This has been reported before:
https://groups.google.com/d/msg/vim_dev/99DYFZvvBNE/xuwuWsZdc1IJ
sounded like a compiler bug to me. Unfortunately now patch has been offered to
fix this issue.
Original comment by chrisbr...@googlemail.com
on 19 Aug 2014 at 7:14
In the past I remember testing several builds and if I remember correctly some
of the 'VIm without cream' builds did also exhibits this problem and thus I
settled on Wu Yongwei's.
Now the situation is 'reversed' as the 'VIm without cream' 402 is the one
working correctly.
on the Stackoverflow link I provided a commenter said that Yongwei's build did
not solve the problem for him...
I'm not familiar with VIm sources so I don't know where to look for ambiguous
code (this problem looks like a missing 'sequence point' where depending on the
circumstances a part of the code would be compiled/executed in a different
order)
Original comment by John.Wel...@gmail.com
on 19 Aug 2014 at 11:18
Ok, I've made an interesting discovery that proves that it's not related to
Microsoft compiler as implied in
https://groups.google.com/d/msg/vim_dev/99DYFZvvBNE/xuwuWsZdc1IJ
I've managed to compile two versions of gvim using mingw64 one for i686 and the
other for x86-64 (both with directx):
the i686 32it version doesn't have the issue discussed here while the x64 build
does!
So I have a build environment where I can easily reproduce the problem, any
idea where to look in the sources for dead key handling?
Original comment by John.Wel...@gmail.com
on 20 Aug 2014 at 2:41
Can you try, if building without optimiziations fixes your issue as well?
Original comment by chrisbr...@googlemail.com
on 20 Aug 2014 at 7:02
I've found and fixed the problem. Here is a patch.
A custom MSG structure used for sending a fake VK_SPACE was declared locally
before being used with TranslateMessage().
Solution: declare the MSG struct statically instead.
Original comment by John.Wel...@gmail.com
on 20 Aug 2014 at 9:06
Attachments:
Looks like a solution. Increases Vim's size by SIZEOF(MSG) again, though :-)
Original comment by christ.v...@coosto.com
on 20 Aug 2014 at 9:20
I came up with a much nicer solution that actually addresses the underlying
issue and that decreases Vim's size^^
Besides this bug, dead key handling was not behaving like in other Windows
application.
I spent some time understanding
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646267(v=vs.85).aspx#_
win32_Dead_Character_Messages
So the solution is to reset dead_key as soon as any WM_CHAR is received and to
_NOT_ do anything special if dead_key is set and the key being pressed is
either VK_SPACE, VK_BACK or VK_ESCAPE in which case we just let WIndows
generate its WM_CHAR: just one will be generated if it's VK_SPACE being pressed
or two will be if it's either VK_BACK or VK_ESCPAE (the dead key + the VK_BACK
or VK_ESCPAE)
My patch includes a detailed comment on the logic used
The fix is very simple and feels just right :)
Original comment by John.Wel...@gmail.com
on 20 Aug 2014 at 7:06
Attachments:
Included as patch 7.4.413
Original comment by brammool...@gmail.com
on 22 Aug 2014 at 4:45
Original issue reported on code.google.com by
John.Wel...@gmail.com
on 19 Aug 2014 at 12:09