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

Patch 7.4.142

Expand Messages
  • Bram Moolenaar
    Patch 7.4.142 (after 7.4.137) Problem: On MS-Windows 8 IME input doen t work correctly. Solution: Work around the problem. (Nobuhiro Takasaki) Files:
    Message 1 of 8 , Jan 12, 2014
      Patch 7.4.142 (after 7.4.137)
      Problem: On MS-Windows 8 IME input doen't work correctly.
      Solution: Work around the problem. (Nobuhiro Takasaki)
      Files: src/os_win32.c


      *** ../vim-7.4.141/src/os_win32.c 2014-01-10 18:16:00.000000000 +0100
      --- src/os_win32.c 2014-01-12 13:23:24.000000000 +0100
      ***************
      *** 234,289 ****

      /*
      * Version of ReadConsoleInput() that works with IME.
      */
      static BOOL
      read_console_input(
      ! HANDLE hConsoleInput,
      ! PINPUT_RECORD lpBuffer,
      ! DWORD nLength,
      ! LPDWORD lpNumberOfEventsRead)
      {
      enum
      {
      ! IRSIZE = 10, /* rough value */
      };
      ! static INPUT_RECORD irCache[IRSIZE];
      static DWORD s_dwIndex = 0;
      static DWORD s_dwMax = 0;
      !
      ! if (hConsoleInput == NULL || lpBuffer == NULL)
      ! return ReadConsoleInput(hConsoleInput, lpBuffer, nLength,
      ! lpNumberOfEventsRead);
      !
      ! if (nLength == -1)
      ! {
      ! if (s_dwMax == 0)
      ! {
      ! PeekConsoleInput(hConsoleInput, lpBuffer, 1, lpNumberOfEventsRead);
      ! if (*lpNumberOfEventsRead == 0)
      ! return FALSE;
      ! ReadConsoleInput(hConsoleInput, irCache, IRSIZE, &s_dwMax);
      ! s_dwIndex = 0;
      ! }
      ! ((PINPUT_RECORD)lpBuffer)[0] = irCache[s_dwIndex];
      ! *lpNumberOfEventsRead = 1;
      ! return TRUE;
      ! }

      if (s_dwMax == 0)
      {
      ! ReadConsoleInput(hConsoleInput, irCache, IRSIZE, &s_dwMax);
      s_dwIndex = 0;
      ! if (s_dwMax == 0)
      {
      ! *lpNumberOfEventsRead = 0;
      ! return FALSE;
      }
      }
      !
      ! ((PINPUT_RECORD)lpBuffer)[0] = irCache[s_dwIndex];
      ! if (++s_dwIndex == s_dwMax)
      s_dwMax = 0;
      ! *lpNumberOfEventsRead = 1;
      return TRUE;
      }

      --- 234,275 ----

      /*
      * Version of ReadConsoleInput() that works with IME.
      + * Works around problems on Windows 8.
      */
      static BOOL
      read_console_input(
      ! HANDLE hInput,
      ! INPUT_RECORD *lpBuffer,
      ! DWORD nLength,
      ! LPDWORD lpEvents)
      {
      enum
      {
      ! IRSIZE = 10
      };
      ! static INPUT_RECORD s_irCache[IRSIZE];
      static DWORD s_dwIndex = 0;
      static DWORD s_dwMax = 0;
      ! DWORD dwEvents;

      if (s_dwMax == 0)
      {
      ! if (nLength == -1)
      ! return PeekConsoleInput(hInput, lpBuffer, 1, lpEvents);
      ! if (!ReadConsoleInput(hInput, s_irCache, IRSIZE, &dwEvents))
      ! return FALSE;
      s_dwIndex = 0;
      ! s_dwMax = dwEvents;
      ! if (dwEvents == 0)
      {
      ! *lpEvents = 0;
      ! return TRUE;
      }
      }
      ! *lpBuffer = s_irCache[s_dwIndex];
      ! if (nLength != -1 && ++s_dwIndex >= s_dwMax)
      s_dwMax = 0;
      ! *lpEvents = 1;
      return TRUE;
      }

      ***************
      *** 292,304 ****
      */
      static BOOL
      peek_console_input(
      ! HANDLE hConsoleInput,
      ! PINPUT_RECORD lpBuffer,
      ! DWORD nLength,
      ! LPDWORD lpNumberOfEventsRead)
      {
      ! return read_console_input(hConsoleInput, lpBuffer, -1,
      ! lpNumberOfEventsRead);
      }

      static void
      --- 278,289 ----
      */
      static BOOL
      peek_console_input(
      ! HANDLE hInput,
      ! INPUT_RECORD *lpBuffer,
      ! DWORD nLength,
      ! LPDWORD lpEvents)
      {
      ! return read_console_input(hInput, lpBuffer, -1, lpEvents);
      }

      static void
      ***************
      *** 585,594 ****
      static BOOL
      win32_enable_privilege(LPTSTR lpszPrivilege, BOOL bEnable)
      {
      ! BOOL bResult;
      ! LUID luid;
      ! HANDLE hToken;
      ! TOKEN_PRIVILEGES tokenPrivileges;

      if (!OpenProcessToken(GetCurrentProcess(),
      TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
      --- 570,579 ----
      static BOOL
      win32_enable_privilege(LPTSTR lpszPrivilege, BOOL bEnable)
      {
      ! BOOL bResult;
      ! LUID luid;
      ! HANDLE hToken;
      ! TOKEN_PRIVILEGES tokenPrivileges;

      if (!OpenProcessToken(GetCurrentProcess(),
      TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
      *** ../vim-7.4.141/src/version.c 2014-01-10 18:16:00.000000000 +0100
      --- src/version.c 2014-01-12 13:17:47.000000000 +0100
      ***************
      *** 740,741 ****
      --- 740,743 ----
      { /* Add new patch number below this line */
      + /**/
      + 142,
      /**/

      --
      Drink wet cement and get really stoned.

      /// 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/groups/opt_out.
    • mattn
      I have problem with this patch. After applying this patch, I often meet screen flickers with typing characters. It seems that PeekConsoleInput must return a
      Message 2 of 8 , Jan 28, 2014
        I have problem with this patch.

        After applying this patch, I often meet screen flickers with typing characters. It seems that PeekConsoleInput must return a value for the real-time result instead of cache on windows7 or older. Below is a patch to disable 7.4.142

        https://gist.github.com/8664740

        Please check and include.

        --
        --
        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/groups/opt_out.
      • mattn
        I updated the patch. -- -- 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
        Message 3 of 8 , Jan 28, 2014
          I updated the patch.

          --
          --
          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/groups/opt_out.
        • Bram Moolenaar
          ... Thanks, I ll check it out soon. -- hundred-and-one symptoms of being an internet addict: 226. You sit down at the computer right after dinner and your
          Message 4 of 8 , Jan 28, 2014
            Yasuhiro Matsumoto wrote:

            > I have problem with this patch.
            >
            > After applying this patch, I often meet screen flickers with typing
            > characters. It seems that PeekConsoleInput must return a value for the
            > real-time result instead of cache on windows7 or older. Below is a
            > patch to disable 7.4.142
            >
            > https://gist.github.com/8664740
            >
            > Please check and include.

            Thanks, I'll check it out soon.

            --
            hundred-and-one symptoms of being an internet addict:
            226. You sit down at the computer right after dinner and your spouse
            says "See you in the morning."

            /// 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/groups/opt_out.
          • Nobuhiro Takasaki
            It can not be resolved this additional change. Are there likely to be resolved in this patch in his environment, but the cause is different. Below, it has not
            Message 5 of 8 , Jan 29, 2014
              It can not be resolved this additional change.

              Are there likely to be resolved in this patch in his environment, but the cause is different.

              Below, it has not been reviewed look at the code of the OS, it is only expected.

              ReadConsoleInput does not return control if the buffer is empty. Hardware keyboard and mouse events occur in the timing of VSYNC, it returns control immediately after.

              Because one by one get the event in os_win32.c, therefore screen updates occur every VSYNC, it works nicely.

              By the way, changing the size of the DOS window in the start-up procedure of Vim, window resize event is posted in the buffer around six.

              These events are not processed in each VSYNC, flicker is now out.

              That's it.

              The recent patch is the conclusion that issued in consideration of the side effects and simplicity.

              I think that it might be of need not be changed to the patch.
              This flicker problem is eliminated by another patch.

              (It is a flicker of one-time, but I wonder if it is to be worried about so much?)

              --------
              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/groups/opt_out.
            • Nobuhiro Takasaki
              There is another patch here. Clear the window resize event that has no meaning to be generated continuously and to suppress the occurrence of flicker.
              Message 6 of 8 , Jan 29, 2014
                There is another patch here.
                Clear the window resize event that has no meaning to be generated continuously and to suppress the occurrence of flicker.

                https://gist.github.com/ntak/8700490

                Even Windows7, even Windows8, Windows in the future, too, will work correctly.

                --------
                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/groups/opt_out.
              • Bram Moolenaar
                ... So this is instead of the patch from Yasuhiro Matsumoto? -- hundred-and-one symptoms of being an internet addict: 241. You try to look for Net Search even
                Message 7 of 8 , Jan 30, 2014
                  Nobuhiro Takasaki wrote:

                  > There is another patch here.
                  > Clear the window resize event that has no meaning to be generated continuously and to suppress the occurrence of flicker.
                  >
                  > https://gist.github.com/ntak/8700490
                  >
                  > Even Windows7, even Windows8, Windows in the future, too, will work correctly.

                  So this is instead of the patch from Yasuhiro Matsumoto?

                  --
                  hundred-and-one symptoms of being an internet addict:
                  241. You try to look for Net Search even when you're in File Manager.

                  /// 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/groups/opt_out.
                • Nobuhiro Takasaki
                  ... Thank you very much. I was speaking in various ways, but from me, I would appreciate it if you apply both patches. ... Thanks. Nobuhiro Takasaki -- -- You
                  Message 8 of 8 , Jan 30, 2014
                    > So this is instead of the patch from Yasuhiro Matsumoto?

                    Thank you very much.
                    I was speaking in various ways, but from me, I would appreciate it if you apply both patches.

                    --------
                    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/groups/opt_out.
                  Your message has been successfully submitted and would be delivered to recipients shortly.