Loading ...
Sorry, an error occurred while loading the content.

Shifted Special Characters in vim-7 (mac)

Expand Messages
  • Stephen Riehm
    Hi Guys, one problem I have with vim-7 on macs is that the shifted special characters, like D-( or D- , only come through in their unshifted forms, in the
    Message 1 of 4 , Apr 4, 2007
    • 0 Attachment
      Hi Guys,

      one problem I have with vim-7 on macs is that the shifted special
      characters, like D-( or D-", only come through in their unshifted
      forms, in the previous examples D-9 and D-'. This has been my K.O.
      criteria for vim-7 in the past.

      I hunted through the code and found a line in gui_mac.c which
      explicitly removes the shift modifier in the mistaken belief that you
      would get something like shift-( if it didn't. I removed the
      offending code and now my macros work beautifully again (for me :-).

      However, I've only tested this on OS-X 10.4.9 on a MacBook Pro (Intel).

      This is just a preliminary patch (commenting out a few lines).
      How can I go about having this code tested and eventually included in
      the CVS code?

      I've also included a patch to install rgb.txt on OS-X - hasn't that
      annoyed anyone yet?

      Cheers,

      Steve
    • Nicolas Weber
      Hi, ... SVN version or officially released version? ... This line is there for a reason (but I don t remember the reason atm :- ). The other guis have it, and
      Message 2 of 4 , Apr 5, 2007
      • 0 Attachment
        Hi,

        > one problem I have with vim-7 on macs is that the shifted special
        > characters, like D-( or D-", only come through in their unshifted
        > forms, in the previous examples D-9 and D-'. This has been my K.O.
        > criteria for vim-7 in the past.

        SVN version or officially released version?

        > I hunted through the code and found a line in gui_mac.c which
        > explicitly removes the shift modifier in the mistaken belief that
        > you would get something like shift-( if it didn't. I removed the
        > offending code and now my macros work beautifully again (for me :-).

        This line is there for a reason (but I don't remember the reason
        atm :-\ ). The other guis have it, and I believe you would get
        something like shift-( without this line. Which keyboard layout are
        you using?

        Here's a list with some problems my keyboard patch had (some problems
        are still there): http://macvim.blogspot.com/2006/10/keyboard-
        handling-patch.html

        > This is just a preliminary patch (commenting out a few lines).
        > How can I go about having this code tested and eventually included
        > in the CVS code?
        >
        > I've also included a patch to install rgb.txt on OS-X - hasn't that
        > annoyed anyone yet?

        This mailing list strips attachments for some reason and there seems
        to be nobody who can fix this. So add your patches to http://
        wiki.macvim.org/wiki/VimPatches/ and wait for feedback.

        Bye,
        Nico
      • Stephen Riehm
        Hi Nico, ... erm... cvs? I used the cvs -z3 -d:pserver:anonymous@vim.cvs.sf.net:/cvsroot/vim checkout vim7 line from http://www.vim.org/cvs.php. My mbp is
        Message 3 of 4 , Apr 5, 2007
        • 0 Attachment
          Hi Nico,

          On 05.04.2007, at 01:16, Nicolas Weber wrote:

          >> one problem I have with vim-7 on macs is that the shifted special
          >> characters, like D-( or D-", only come through in their unshifted
          >> forms, in the previous examples D-9 and D-'. This has been my K.O.
          >> criteria for vim-7 in the past.
          >
          > SVN version or officially released version?

          erm... cvs? I used the

          cvs -z3 -d:pserver:anonymous@...:/cvsroot/vim checkout vim7

          line from http://www.vim.org/cvs.php.
          My mbp is brand new and I'm still on holidays, so I haven't installed
          much on it yet, including svn. I'll be home next week.
          What's the preferred reference?

          >> I hunted through the code and found a line in gui_mac.c which
          >> explicitly removes the shift modifier in the mistaken belief that
          >> you would get something like shift-( if it didn't. I removed the
          >> offending code and now my macros work beautifully again (for me :-).
          >
          > This line is there for a reason (but I don't remember the reason
          > atm :-\ ). The other guis have it, and I believe you would get
          > something like shift-( without this line. Which keyboard layout are
          > you using?

          I thought it might be :-)
          I'm using the US Keyboard layout on a US Keyboard MacBook Pro -
          nothing fancy.
          For what it's worth - what would be the problem if shift-( turned up?
          I know that on german keyboards, < and > are not shifted, while they
          are on US keyboards.
          Since only shift-, was arriving at the line I commented out - maybe
          we have a different problem (ie: why isn't < turning up instead of
          shift-,)

          > Here's a list with some problems my keyboard patch had (some
          > problems are still there): http://macvim.blogspot.com/2006/10/
          > keyboard-handling-patch.html

          OK - I've downloaded your patch and I'll have a look at it.

          >> This is just a preliminary patch (commenting out a few lines).
          >> How can I go about having this code tested and eventually included
          >> in the CVS code?
          >>
          >> I've also included a patch to install rgb.txt on OS-X - hasn't
          >> that annoyed anyone yet?
          >
          > This mailing list strips attachments for some reason and there
          > seems to be nobody who can fix this. So add your patches to http://
          > wiki.macvim.org/wiki/VimPatches/ and wait for feedback.

          I'll get back to you once I've checked out your patch and the
          regressions you mentioned.
          Thanks!

          Steve
        • Nicolas Weber
          Hi, ... ;-) That question was meant along the lines official release or latest version . Sorry. So, what are the first three lines of the output of :version?
          Message 4 of 4 , Apr 5, 2007
          • 0 Attachment
            Hi,

            >> SVN version or officially released version?
            >
            > erm... cvs? I used the

            ;-) That question was meant along the lines "official release or
            latest version". Sorry. So, what are the first three lines of the
            output of :version? (ie, which patches are included?).

            Did you pass --enable-multibyte to ./configure (does :version shoe
            "+multibyte)? There are some problems if you don't compile with
            multibyte support.

            > My mbp is brand new and I'm still on holidays, so I haven't
            > installed much on it yet, including svn. I'll be home next week.
            > What's the preferred reference?

            For installing svn? If 1.3 is good enough for you, go to http://
            metissian.com/projects/macosx/subversion/ (this is what http://
            subversion.tigris.org/project_packages.html recommends if you don't
            want to use fink). If you want to compile it yourself, http://
            developer.apple.com/tools/subversionxcode.html provides a good walk-
            through.

            > For what it's worth - what would be the problem if shift-( turned up?

            Well, if you mapped ( to something, the mapping wouldn't be triggered
            if only shift-( would arrive iirc.

            > I know that on german keyboards, < and > are not shifted, while
            > they are on US keyboards.

            FWIW, > is shifted on german keyboards (it's shift-<). The idea is to
            remove 'redundant' modifiers which were already used to produce the
            char code.

            > OK - I've downloaded your patch and I'll have a look at it.

            This patch got included in the official vim source as patch 7.0.138
            (that's why I feel a bit responsible for your problems ;-) ). Perhaps
            you're already using it.

            However, if I hit C-V D-S-9 in insert mode, I get <D-S-9> instead of
            <D-(> as well. It seems this patch doesn't help.

            I have the impression that if Cmd is pressed, Carbon doesn't use
            Shift to translate the 'base character'. If you hit C-V D-S-k, you
            end up with <D-S-k> instead of <D-K> as well. On the other hand, if
            you hit C-V D-M-;, you end up with <D-M-…>.

            This document is related to this: http://developer.apple.com/qa/
            qa2005/qa1446.html .


            I think we should create a wiki page which lists all these test cases
            (along with the expected behaviour)...do you want to do this? :-)

            Bye,
            Nico
          Your message has been successfully submitted and would be delivered to recipients shortly.