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

Can't input 0xCE on windows console

Expand Messages
  • mattn
    Hi. When using vim.exe with encoding=cp932 (Shift_JIS encoding) I can t input 0xCE (ホ). Because K_NUL is same value. It seems that some characters are
    Message 1 of 11 , Jun 5, 2014
    • 0 Attachment
      Hi.

      When using vim.exe with encoding=cp932 (Shift_JIS encoding)
      I can't input 0xCE (ホ). Because K_NUL is same value.
      It seems that some characters are registered as mappings. I want to change the value of K_NUL. For example 0xFF.

      https://gist.github.com/mattn/b6341a1d272aa80431c5

      How do you think?

      Thanks.
      - Yasuhiro Matsumoto

      --
      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/d/optout.
    • Bram Moolenaar
      ... What is supposed to happen is that 0xce is replaced by K_NUL 3. What is the reason that is not working? Perhaps the translation of 0xce to K_NUL and 3 is
      Message 2 of 11 , Jun 5, 2014
      • 0 Attachment
        Yasuhiro Matsumoto wrote:

        > When using vim.exe with encoding=cp932 (Shift_JIS encoding)
        > I can't input 0xCE (ホ). Because K_NUL is same value.
        > It seems that some characters are registered as mappings. I want to
        > change the value of K_NUL. For example 0xFF.
        >
        > https://gist.github.com/mattn/b6341a1d272aa80431c5
        >
        > How do you think?

        What is supposed to happen is that 0xce is replaced by K_NUL 3.
        What is the reason that is not working? Perhaps the translation of 0xce
        to K_NUL and 3 is missing somewhere?

        Changing K_NUL to 0xff will only move the problem to another character.

        --
        hundred-and-one symptoms of being an internet addict:
        267. You get an extra phone line so you can get phone calls.

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ an exciting new programming language -- http://www.Zimbu.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --
        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/d/optout.
      • mattn
        Do you mean that 0xCE should be replaced as K_NUL 3 in mch_inchar? Currently, windows console version provide some key mappings to keys which has prefix 0xCE.
        Message 3 of 11 , Jun 5, 2014
        • 0 Attachment
          Do you mean that 0xCE should be replaced as K_NUL 3 in mch_inchar?

          Currently, windows console version provide some key mappings to keys which has prefix 0xCE. So if i type 0xCE, vim wait for timeout.

          On Friday, June 6, 2014 2:40:35 AM UTC+9, Bram Moolenaar wrote:
          > Yasuhiro Matsumoto wrote:
          >
          >
          >
          > > When using vim.exe with encoding=cp932 (Shift_JIS encoding)
          >
          > > I can't input 0xCE (ホ). Because K_NUL is same value.
          >
          > > It seems that some characters are registered as mappings. I want to
          >
          > > change the value of K_NUL. For example 0xFF.
          >
          > >
          >
          > > https://gist.github.com/mattn/b6341a1d272aa80431c5
          >
          > >
          >
          > > How do you think?
          >
          >
          >
          > What is supposed to happen is that 0xce is replaced by K_NUL 3.
          >
          > What is the reason that is not working? Perhaps the translation of 0xce
          >
          > to K_NUL and 3 is missing somewhere?
          >
          >
          >
          > Changing K_NUL to 0xff will only move the problem to another character.
          >
          >
          >
          > --
          >
          > hundred-and-one symptoms of being an internet addict:
          >
          > 267. You get an extra phone line so you can get phone calls.
          >
          >
          >
          > /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          >
          > /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
          >
          > \\\ an exciting new programming language -- http://www.Zimbu.org ///
          >
          > \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

          --
          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/d/optout.
        • Bram Moolenaar
          ... That also indicates that the conversion of typing 0xCE to K_NUL plus 3 is not happening. I haven t looked at this code for ages, no idea if it was always
          Message 4 of 11 , Jun 6, 2014
          • 0 Attachment
            Yasuhiro Matsumoto wrote:

            > Do you mean that 0xCE should be replaced as K_NUL 3 in mch_inchar?
            >
            > Currently, windows console version provide some key mappings to keys
            > which has prefix 0xCE. So if i type 0xCE, vim wait for timeout.

            That also indicates that the conversion of typing 0xCE to K_NUL plus 3
            is not happening. I haven't looked at this code for ages, no idea if it
            was always wrong or some change has broken it.


            --
            hundred-and-one symptoms of being an internet addict:
            271. You collect hilarious signatures from all 250 mailing lists you
            are subscribed to.

            /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
            /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
            \\\ an exciting new programming language -- http://www.Zimbu.org ///
            \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

            --
            --
            You received this message from the "vim_dev" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_dev" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/d/optout.
          • mattn
            OK, below is a patch to convert 0xCE as K_NUL+3. This is converting all K_NUL to K_NUL+3 in typeahead because typeahead may be converted with iconv.
            Message 5 of 11 , Jun 6, 2014
            • 0 Attachment
              OK, below is a patch to convert 0xCE as K_NUL+3.
              This is converting all K_NUL to K_NUL+3 in typeahead because typeahead may be converted with iconv.

              https://gist.github.com/mattn/6f66c3f8186369cabd90

              diff -r bed71c37618c src/getchar.c
              --- a/src/getchar.c Thu May 29 14:36:29 2014 +0200
              +++ b/src/getchar.c Fri Jun 06 22:51:58 2014 +0900
              @@ -1699,7 +1699,7 @@
              c = CSI;
              #endif
              }
              -#ifdef MSDOS
              +#if defined(MSDOS) || (defined(WIN3264) && !defined(FEAT_GUI))
              /*
              * If K_NUL was typed, it is replaced by K_NUL, 3 in mch_inchar().
              * Delete the 3 here.
              diff -r bed71c37618c src/os_win32.c
              --- a/src/os_win32.c Thu May 29 14:36:29 2014 +0200
              +++ b/src/os_win32.c Fri Jun 06 22:51:58 2014 +0900
              @@ -1805,6 +1805,21 @@
              n + unconverted, TYPEAHEADLEN - typeaheadlen,
              rest == NULL ? &rest : NULL, &restlen);
              }
              +
              + /* Convert K_NUL in input characters. */
              + {
              + char_u *p = typeahead + typeaheadlen;
              + char_u *e = typeahead + TYPEAHEADLEN;
              + while (*p && p < e) {
              + if (*p == K_NUL) {
              + p++;
              + mch_memmove(p, p + 1, 1);
              + *p = 3;
              + n++;
              + }
              + p++;
              + }
              + }
              #endif

              /* Use the ALT key to set the 8th bit of the character

              - Yasuhiro Matsumoto


              --
              --
              You received this message from the "vim_dev" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              ---
              You received this message because you are subscribed to the Google Groups "vim_dev" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
              For more options, visit https://groups.google.com/d/optout.
            • mattn
              Hmm, I could 0xCE with this patch. But , , are broken. -- -- You received this message from the vim_dev maillist. Do not top-post!
              Message 6 of 11 , Jun 6, 2014
              • 0 Attachment
                Hmm, I could 0xCE with this patch. But <home>, <pageup>, <pagedown> are broken.

                --
                --
                You received this message from the "vim_dev" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php

                ---
                You received this message because you are subscribed to the Google Groups "vim_dev" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                For more options, visit https://groups.google.com/d/optout.
              • Bram Moolenaar
                ... Thanks, I ll have a good look at it later. -- ARTHUR: This new learning amazes me, Sir Bedevere. Explain again how sheep s bladders may be employed to
                Message 7 of 11 , Jun 6, 2014
                • 0 Attachment
                  Yasuhiro Matsumoto wrote:

                  > OK, below is a patch to convert 0xCE as K_NUL+3.
                  > This is converting all K_NUL to K_NUL+3 in typeahead because typeahead may be converted with iconv.
                  >
                  > https://gist.github.com/mattn/6f66c3f8186369cabd90

                  Thanks, I'll have a good look at it later.

                  --
                  ARTHUR: This new learning amazes me, Sir Bedevere. Explain again how sheep's
                  bladders may be employed to prevent earthquakes.
                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

                  /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                  /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                  \\\ an exciting new programming language -- http://www.Zimbu.org ///
                  \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                  --
                  --
                  You received this message from the "vim_dev" maillist.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php

                  ---
                  You received this message because you are subscribed to the Google Groups "vim_dev" group.
                  To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                  For more options, visit https://groups.google.com/d/optout.
                • mattn
                  Currently, last patch still has below s problems. * :imap a ボ deson t work. replacing all ボ into 1. * :call feedkeys( iホ ) doesn t work
                  Message 8 of 11 , Jun 12, 2014
                  • 0 Attachment
                    Currently, last patch still has below's problems.

                    * ":imap a ボ" deson't work. replacing all ボ into 1.
                    * :call feedkeys("iホ\<C-C>") doesn't work because K_NUL 3 escape duplicatedly.

                    So I suggest to modify termcap for windows.
                    - Yasuhiro Matsumoto

                    --
                    --
                    You received this message from the "vim_dev" maillist.
                    Do not top-post! Type your reply below the text you are replying to.
                    For more information, visit http://www.vim.org/maillist.php

                    ---
                    You received this message because you are subscribed to the Google Groups "vim_dev" group.
                    To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                    For more options, visit https://groups.google.com/d/optout.
                  • Bram Moolenaar
                    ... What exactly are those characters in hex? And what encoding is Vim set to when the problem happens? The patch which was sent previously had another
                    Message 9 of 11 , Jun 12, 2014
                    • 0 Attachment
                      Yasuhiro Matsumoto wrote:

                      > Currently, last patch still has below's problems.
                      >
                      > * ":imap a ボ" deson't work. replacing all ボ into 1.
                      > * :call feedkeys("iホ\<C-C>") doesn't work because K_NUL 3 escape duplicatedly.
                      >
                      > So I suggest to modify termcap for windows.

                      What exactly are those characters in hex? And what encoding is Vim set
                      to when the problem happens?

                      The patch which was sent previously had another problem, thus I haven't
                      included it.

                      --
                      Linux is just like a wigwam: no Windows, no Gates and an Apache inside.

                      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                      \\\ an exciting new programming language -- http://www.Zimbu.org ///
                      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                      --
                      --
                      You received this message from the "vim_dev" maillist.
                      Do not top-post! Type your reply below the text you are replying to.
                      For more information, visit http://www.vim.org/maillist.php

                      ---
                      You received this message because you are subscribed to the Google Groups "vim_dev" group.
                      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                      For more options, visit https://groups.google.com/d/optout.
                    • Nobuhiro Takasaki
                      If I do not get me wrong, it is a way of also solved this patch. :imap a ボ also work normally. This patch is with the cooperation of vim-jp community.
                      Message 10 of 11 , Jun 19, 2014
                      • 0 Attachment
                        If I do not get me wrong, it is a way of also solved this patch.
                        ":imap a ボ" also work normally.

                        This patch is with the cooperation of vim-jp community.

                        --------
                        Thanks.
                        Nobuhiro Takasaki

                        --
                        --
                        You received this message from the "vim_dev" maillist.
                        Do not top-post! Type your reply below the text you are replying to.
                        For more information, visit http://www.vim.org/maillist.php

                        ---
                        You received this message because you are subscribed to the Google Groups "vim_dev" group.
                        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                        For more options, visit https://groups.google.com/d/optout.
                      • Bram Moolenaar
                        ... Thanks! -- A vacation is a period of travel during which you find that you took twice as many clothes and half as much money as you needed. /// Bram
                        Message 11 of 11 , Jun 21, 2014
                        • 0 Attachment
                          Nobuhiro Takasaki wrote:

                          > If I do not get me wrong, it is a way of also solved this patch.
                          > ":imap a ボ" also work normally.
                          >
                          > This patch is with the cooperation of vim-jp community.

                          Thanks!

                          --
                          A vacation is a period of travel during which you find that you
                          took twice as many clothes and half as much money as you needed.

                          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                          /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                          \\\ an exciting new programming language -- http://www.Zimbu.org ///
                          \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                          --
                          --
                          You received this message from the "vim_dev" maillist.
                          Do not top-post! Type your reply below the text you are replying to.
                          For more information, visit http://www.vim.org/maillist.php

                          ---
                          You received this message because you are subscribed to the Google Groups "vim_dev" group.
                          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                          For more options, visit https://groups.google.com/d/optout.
                        Your message has been successfully submitted and would be delivered to recipients shortly.