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

[patch] 2 cell character that is output to the screen does not flash by a space character

Expand Messages
  • Nobuhiro Takasaki
    Hi. What physical condition are you? A result of discussions at the Issue of vim-jp. This is a common problem in a multi-byte countries. In the terminal, if
    Message 1 of 4 , May 13, 2014
    • 0 Attachment
      Hi. What physical condition are you?

      A result of discussions at the Issue of vim-jp.
      This is a common problem in a multi-byte countries.

      In the terminal,
      if the last character in the string is a multi-byte
      character, and by outputting the space character,
      and keep the integrity of the display.

      When it is logic of the current, the output of the
      multi-byte string will end in the middle.

      However, there is a leak in the trick.
      This patch supplemented with leakage.

      "screen_puts_len()" is cast to (int) a 64bit
      pointer arithmetic. Here should be a (long).
      This patch, the workaround is simply it.

      That I learn a lot.

      --------
      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.
    • h_east
      Hi, Bram and Nobuhiro ... I supplement how to reproduce. (from vim-jp [https://github.com/vim-jp/issues/issues/558]) How to reproduce (Reproduce well in
      Message 2 of 4 , May 13, 2014
      • 0 Attachment
        Hi, Bram and Nobuhiro

        2014/5/13(Tus) 23:17:39 UTC+9 Nobuhiro Takasaki:
        > Hi. What physical condition are you?
        >
        > A result of discussions at the Issue of vim-jp.
        > This is a common problem in a multi-byte countries.
        >
        > In the terminal,
        > if the last character in the string is a multi-byte
        > character, and by outputting the space character,
        > and keep the integrity of the display.
        >
        > When it is logic of the current, the output of the
        > multi-byte string will end in the middle.
        >
        > However, there is a leak in the trick.
        > This patch supplemented with leakage.
        >
        > "screen_puts_len()" is cast to (int) a 64bit
        > pointer arithmetic. Here should be a (long).
        > This patch, the workaround is simply it.
        >
        > That I learn a lot.
        >
        > --------
        > Thanks.
        > Nobuhiro Takasaki

        I supplement how to reproduce.
        (from vim-jp [https://github.com/vim-jp/issues/issues/558%5d)

        How to reproduce (Reproduce well in MacOSX)
        1. Prepare a file(.vimrc_test) with the following content:
        set nocompatible
        filetype off
        nnoremap <silent> <Plug>(echoline) :<C-u>call EchoLine()<CR>
        nmap <C-g> <Plug>(echoline)
        function! EchoLine()
        redraw
        echo getline('.')
        endfunction
        filetype plugin indent on
        syntax enable

        2. Prepare a file(test) with the following content: (File encodinf is utf-8)
        ああああああああああ
        aaaaaaaaaa

        3. Startup CUI version Vim. (enc=utf-8)
        $ vim test -u .vimrc_test

        4. Input below
        <C-g> " Displayed with "ああああああああああ" the last line.
        j " Cursor Moved to line 2.
        <C-g>

        Expected behavior
        Displayed with "aaaaaaaaaa" the last line.

        Actual behavior
        Displayed with " a a a a a" the last line.
        Sometime reproduce. (About 30% on MacOSX)


        Nobuhiro's patch is fixed this.

        Thanks.
        --
        Best regards
        Hirohito Higashi

        --
        --
        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 for looking into this and providing a patch. Do you have a reproducible example for the problem? Oh, I see Hirohito Higashi already did that. --
        Message 3 of 4 , May 13, 2014
        • 0 Attachment
          Nobuhiro Takasaki wrote:

          > Hi. What physical condition are you?
          >
          > A result of discussions at the Issue of vim-jp.
          > This is a common problem in a multi-byte countries.
          >
          > In the terminal,
          > if the last character in the string is a multi-byte
          > character, and by outputting the space character,
          > and keep the integrity of the display.
          >
          > When it is logic of the current, the output of the
          > multi-byte string will end in the middle.
          >
          > However, there is a leak in the trick.
          > This patch supplemented with leakage.
          >
          > "screen_puts_len()" is cast to (int) a 64bit
          > pointer arithmetic. Here should be a (long).
          > This patch, the workaround is simply it.
          >
          > That I learn a lot.

          Thanks for looking into this and providing a patch.

          Do you have a reproducible example for the problem?
          Oh, I see Hirohito Higashi already did that.

          --
          hundred-and-one symptoms of being an internet addict:
          158. You get a tuner card so you can watch TV while surfing.

          /// 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
          My example is simple: Please execute and paste it into the command line of Vim this string. echo 0123456789 It is displayed in this part
          Message 4 of 4 , May 13, 2014
          • 0 Attachment
            My example is simple:
            Please execute and paste it into the
            command line of Vim this string.

            echo "0123456789"

            It is displayed in this part of the 64bit
            environment, including me:

            012

            "3456789" is missing.
            This problem function "screen_puts_len()" of.

            This function sets a new pointer to a string in
            "ptr" near the end. However, "len" to the
            length of the string also should I set.

            After this, this function is compared with
            "int width" variable "text" and the new "ptr".
            It should be compared with "long width" in 64bit.

            In view of the meaning of the code, it is changed
            the "(int)" than to "(long)", and ensure the
            correct length of the string being set to the
            new "ptr".

            Fixes that I present is the previous patch.

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