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

Weird:: substitute by using register with combinations

Expand Messages
  • William Fugh
    It s OK if execute the following in command-line directly ... the combinations will be lost. :-( BTW, it is also strictly correct if put the command into a
    Message 1 of 10 , Apr 4 9:53 PM
    View Source
    • 0 Attachment
      It's OK if execute the following in command-line directly
      :%s#combinations#œ̄ṣ́#g

      However, if like this:
      :let @w = "%s#combinations#œ̄ṣ́#g"
      :@w
      the combinations will be lost. :-(

      BTW, it is also strictly correct if put the command into a function and call the function.
      =================================================================
      Vista/Vim V7.3
      termencoding=fileencoding=utf8, fileformat=unix
      maxcombine=2

      =================================================================
      Anybody could tell me how can i avoid this weird result? thanks.


      --
      --
      You received this message from the "vim_use" 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_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
       
       
    • Ben Fritz
      ... I had to try it out to determine what you meant, but I reproduced the problem in Windows 7 64-bit, running Vim 7.3.822. Better problem description: With
      Message 2 of 10 , Apr 5 9:44 AM
      View Source
      • 0 Attachment
        On Thursday, April 4, 2013 11:53:16 PM UTC-5, William Fugh wrote:
        > It's OK if execute the following in command-line directly
        > :%s#combinations#œ̄ṣ́#g
        >
        > However, if like this:
        > :let @w = "%s#combinations#œ̄ṣ́#g"
        > :@w
        > the combinations will be lost. :-(
        >
        >

        I had to try it out to determine what you meant, but I reproduced the problem in Windows 7 64-bit, running Vim 7.3.822.

        Better problem description:

        With text:

        one combinations two combinations three

        Executing :%s#combinations#œ̄ṣ́#g directly, will correctly replace the text with:

        one œ̄ṣ́ two œ̄ṣ́ three

        But saving "%s#combinations#œ̄ṣ́#g" to register w, and then executing with :@w, results in:

        one œṣ two œṣ three

        Note the lack of combining characters in the resulting text.

        At this point, :reg w shows:

        --- Registers ---
        "w %s#combinations#œ̄ṣ́#g

        So the register value was set properly, this seems like a problem in Vim.

        This all happens with gvim -N -u NONE -i NONE, after only setting encoding to utf-8 and setting an appropriate font.

        --
        --
        You received this message from the "vim_use" 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_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • William Fugh
        ... Thank you, Sir. Here is the thing. Sometimes i have to execute a number of substitutions over and over again from testing, inspection to confirmation,
        Message 3 of 10 , Apr 6 1:49 AM
        View Source
        • 0 Attachment

          On Sat, Apr 6, 2013 at 3:44 AM, Ben Fritz <fritzophrenic@...> wrote:


          I had to try it out to determine what you meant, but I reproduced the problem in Windows 7 64-bit, running Vim 7.3.822.
          Thank you, Sir. Here is the thing.

          Sometimes i have to execute a number of substitutions over and over again from testing, inspection to confirmation, which covers various aspects of various combinations(e.g. historical characters of Proto-Indo-European). Just like:
          =============================
          %s#_piechar1_#u̯#g
          %s#_piechar2_#œ̄#g
          %s#_piechar3_#i̷#g
          %s#_piechar4_#x̿#g
          %s#_piechar5_#y̥#g
          .....
          %s#_piecharn_#t̞#g
          =============================
          So I usually save/modify/keep these commands in a file, test them one by one. After verification,  I copy all of them into a register(e.g. register w) and then run them in command-line as follows.
          :@w
          :@0
          ....
          :@:
          :@@
          Unfortunately all the above operations were failed if the command(s) contain(s) combination(s).



          On Sat, Apr 6, 2013 at 3:44 AM, Ben Fritz <fritzophrenic@...> wrote:
          On Thursday, April 4, 2013 11:53:16 PM UTC-5, William Fugh wrote:
          > It's OK if execute the following in command-line directly
          > :%s#combinations#œ̄ṣ́#g
          >
          > However, if like this:
          > :let @w = "%s#combinations#œ̄ṣ́#g"
          > :@w
          > the combinations will be lost. :-(
          >
          >

          I had to try it out to determine what you meant, but I reproduced the problem in Windows 7 64-bit, running Vim 7.3.822.

          Better problem description:

          With text:

            one combinations two combinations three

          Executing :%s#combinations#œ̄ṣ́#g directly, will correctly replace the text with:

            one œ̄ṣ́ two œ̄ṣ́ three

          But saving "%s#combinations#œ̄ṣ́#g" to register w, and then executing with :@w, results in:

            one œṣ two œṣ three

          Note the lack of combining characters in the resulting text.

          At this point, :reg w shows:

          --- Registers ---
          "w   %s#combinations#œ̄ṣ́#g

          So the register value was set properly, this seems like a problem in Vim.

          This all happens with gvim -N -u NONE -i NONE, after only setting encoding to utf-8 and setting an appropriate font.

          --
          --
          You received this message from the "vim_use" 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_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.



          --
          --
          You received this message from the "vim_use" 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_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
           
           
        • John Little
          In gvim 7.3.882, gtk2-gnome gui, Kubuntu 12.10, I see the problem. (Also in vim with uxterm.) (They re more usually called combining characters, and your
          Message 4 of 10 , Apr 6 2:51 AM
          View Source
          • 0 Attachment
            In gvim 7.3.882, gtk2-gnome gui, Kubuntu 12.10, I see the problem. (Also in vim with uxterm.)

            (They're more usually called "combining" characters, and your examples all have what Unicode calls combining diacritical marks, f.ex.
            ̞
            U+031E, COMBINING DOWN TACK BELOW
            I mention this because I did not understand your problem report on first reading.)

            Regards, John Little

            --
            --
            You received this message from the "vim_use" 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_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Christian Brabandt
            Hi William! ... It s a combining char ;) BTW: Here is a patch. regards, Christian -- -- -- You received this message from the vim_use maillist. Do not
            Message 5 of 10 , Apr 6 2:13 PM
            View Source
            • 0 Attachment
              Hi William!

              On Fr, 05 Apr 2013, William Fugh wrote:

              > It's OK if execute the following in command-line directly
              > :%s#combinations#œ̄ṣ́#g
              >
              > However, if like this:
              > :let @w = "%s#combinations#œ̄ṣ́#g"
              > :@w
              > the combinations will be lost. :-(

              It's a combining char ;)

              BTW: Here is a patch.

              regards,
              Christian
              --

              --
              --
              You received this message from the "vim_use" 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_use" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • John Little
              ... Patch fixes it for me. Regards, John -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are
              Message 6 of 10 , Apr 6 7:52 PM
              View Source
              • 0 Attachment
                On Sunday, April 7, 2013 9:13:55 AM UTC+12, Christian Brabandt wrote:

                > BTW: Here is a patch.

                Patch fixes it for me.

                Regards, John

                --
                --
                You received this message from the "vim_use" 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_use" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              • William Fugh
                BTW: Here is a patch. ... -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are replying to. For
                Message 7 of 10 , Apr 7 3:49 AM
                View Source
                • 0 Attachment


                  BTW: Here is a patch.

                  Well done, thank you guys so much. :-)



                  On Sun, Apr 7, 2013 at 7:13 AM, Christian Brabandt <cblists@...> wrote:
                  Hi William!

                  On Fr, 05 Apr 2013, William Fugh wrote:

                  > It's OK if execute the following in command-line directly
                  > :%s#combinations#œ̄ṣ́#g
                  >
                  > However, if like this:
                  > :let @w = "%s#combinations#œ̄ṣ́#g"
                  > :@w
                  > the combinations will be lost. :-(

                  It's a combining char ;)

                  BTW: Here is a patch.

                  regards,
                  Christian
                  --

                  --
                  --
                  You received this message from the "vim_use" 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_use" group.
                  To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                  For more options, visit https://groups.google.com/groups/opt_out.



                  --
                  --
                  You received this message from the "vim_use" 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_use" group.
                  To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                  For more options, visit https://groups.google.com/groups/opt_out.
                   
                   
                • Christian Brabandt
                  Hi William! ... Actually, it is not quite right. I forgot, there could be several combining chars. So here is an updated patch. Bram, please check. regards,
                  Message 8 of 10 , Apr 7 4:50 AM
                  View Source
                  • 0 Attachment
                    Hi William!

                    On So, 07 Apr 2013, William Fugh wrote:

                    > BTW: Here is a patch.
                    > >
                    > > Well done, thank you guys so much. :-)

                    Actually, it is not quite right. I forgot, there could be several
                    combining chars. So here is an updated patch. Bram, please check.

                    regards,
                    Christian
                    --
                    Nett sein kann jeder - meckern ist wichtig!

                    --
                    --
                    You received this message from the "vim_use" 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_use" group.
                    To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                    For more options, visit https://groups.google.com/groups/opt_out.
                  • Bram Moolenaar
                    ... Thanks! -- Birthdays are healthy. The more you have them, the longer you live. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net
                    Message 9 of 10 , Apr 7 9:54 AM
                    View Source
                    • 0 Attachment
                      Christian Brabandt wrote:

                      > Hi William!
                      >
                      > On Fr, 05 Apr 2013, William Fugh wrote:
                      >
                      > > It's OK if execute the following in command-line directly
                      > > :%s#combinations#œ̄ṣ́#g
                      > >
                      > > However, if like this:
                      > > :let @w = "%s#combinations#œ̄ṣ́#g"
                      > > :@w
                      > > the combinations will be lost. :-(
                      >
                      > It's a combining char ;)
                      >
                      > BTW: Here is a patch.

                      Thanks!

                      --
                      Birthdays are healthy. The more you have them, the longer you live.

                      /// 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_use" 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_use" group.
                      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                      For more options, visit https://groups.google.com/groups/opt_out.
                    • John Little
                      ... I checked this using the manually assembled character œ̄́ which firefox does not render for me (gvim sort of does, when the cursor is on the
                      Message 10 of 10 , Apr 8 4:24 AM
                      View Source
                      • 0 Attachment
                        On Sunday, April 7, 2013 11:50:09 PM UTC+12, Christian Brabandt wrote:

                        > Actually, it is not quite right. I forgot, there could be several
                        > combining chars. So here is an updated patch.

                        I checked this using the manually assembled character "œ̄́" which firefox does not render for me (gvim sort of does, when the cursor is on the character). AFAICT test 44 still does not test more than one combining character; I found "שּׁ" from
                        http://www.user.uni-hannover.de/nhtcapri/combining-marks.html near the end, perhaps the test could use it as a real example.

                        Regards, John Little

                        --
                        --
                        You received this message from the "vim_use" 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_use" group.
                        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+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.