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

Re: Highlighting broken with re=2

Expand Messages
  • Axel Bender
    Hi, Bram, you may as well elimitate the inverted question mark (I just forgot to replace it in the example - in the base document there are no xs), the result
    Message 1 of 14 , Jun 12, 2013
    • 0 Attachment
      Hi, Bram,

      you may as well elimitate the inverted question mark (I just forgot to replace it in the example - in the base document there are no xs), the result is the same.
      Also, the effect is independent from enc (I tested it with both, utf8 and latin1). In both cases fenc was empty.

      --
      --
      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
      ... Well, something must be different, I still can t reproduct it. Can anybody else see the problem? -- hundred-and-one symptoms of being an internet addict:
      Message 2 of 14 , Jun 12, 2013
      • 0 Attachment
        Axel Bender wrote:

        > you may as well elimitate the inverted question mark (I just forgot to
        > replace it in the example - in the base document there are no xs), the
        > result is the same.
        > Also, the effect is independent from enc (I tested it with both, utf8
        > and latin1). In both cases fenc was empty.

        Well, something must be different, I still can't reproduct it.

        Can anybody else see the problem?

        --
        hundred-and-one symptoms of being an internet addict:
        170. You introduce your wife as "my_lady@..." and refer to your
        children as "forked processes."

        /// 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.
      • Manuel Ortega
        I can t reproduce on OS X 10.8.4, using MacVim, which is at 7.3.1168. I don t get what matches the .png file; I get the same colors whether re=1 or re=2. I
        Message 3 of 14 , Jun 12, 2013
        • 0 Attachment
          I can't reproduce on OS X 10.8.4, using MacVim, which is at 7.3.1168.  I don't get what matches the .png file; I get the same colors whether re=1 or re=2.

          I can't test console vim because the file lang.vim only defines gui colors.  Therefore, I see no highlighting no matter what.

          -Manny


          On Wed, Jun 12, 2013 at 12:11 PM, Bram Moolenaar <Bram@...> wrote:

          Axel Bender wrote:

          > you may as well elimitate the inverted question mark (I just forgot to
          > replace it in the example - in the base document there are no xs), the
          > result is the same.
          > Also, the effect is independent from enc (I tested it with both, utf8
          > and latin1). In both cases fenc was empty.

          Well, something must be different, I still can't reproduct it.

          Can anybody else see the problem?

          --
          hundred-and-one symptoms of being an internet addict:
          170. You introduce your wife as "my_lady@..." and refer to your
               children as "forked processes."

           /// 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.



          --
          --
          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.
           
           
        • Axel Bender
          Created a vid: http://youtu.be/z4DPiNVddjg -- -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text you are
          Message 4 of 14 , Jun 12, 2013
          • 0 Attachment
            Created a vid: http://youtu.be/z4DPiNVddjg

            --
            --
            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.
          • Dominique Pellé
            ... I can reproduce it using Vim-7.2.1182 and the spanish.txt and lang.vim files posted in the first message of this thread. Here is an automated way to
            Message 5 of 14 , Jun 12, 2013
            • 0 Attachment
              Bram Moolenaar <Bram@...> wrote:

              > Axel Bender wrote:
              >
              >> you may as well elimitate the inverted question mark (I just forgot to
              >> replace it in the example - in the base document there are no xs), the
              >> result is the same.
              >> Also, the effect is independent from enc (I tested it with both, utf8
              >> and latin1). In both cases fenc was empty.
              >
              > Well, something must be different, I still can't reproduct it.
              >
              > Can anybody else see the problem?


              I can reproduce it using Vim-7.2.1182 and the
              "spanish.txt" and "lang.vim" files posted in the
              first message of this thread.

              Here is an automated way to reproduce
              which should be easier:

              $ vim -f -g -U NONE -u NONE -i NONE --noplugin -N \
              spanish.txt \
              -c 'call feedkeys(":set re=1\<CR>:so lang.vim\<CR>GA abc\<Esc>k")'

              (notice that "abc" at the end of the last line has orange background)

              Now do the same but with re=2:

              $ vim -f -g -U NONE -u NONE -i NONE --noplugin -N \
              spanish.txt \
              -c 'call feedkeys(:set re=2\<CR>:so lang.vim\<CR>GA abc\<Esc>k")'

              (notice that "abc" has now a white background,
              which is different than before, but press CTRL-L
              and notice that background of "abc" on last line
              becomes orange)

              Dominique

              --
              --
              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.
            • Manuel Ortega
              On Wed, Jun 12, 2013 at 5:37 PM, Dominique Pellé ... Nope. Orange background for both, MacVim 7.3.1168. The second shell command is missing a double-quote
              Message 6 of 14 , Jun 12, 2013
              • 0 Attachment
                On Wed, Jun 12, 2013 at 5:37 PM, Dominique Pellé <dominique.pelle@...> wrote:
                Bram Moolenaar <Bram@...> wrote:

                > Axel Bender wrote:
                >
                >> you may as well elimitate the inverted question mark (I just forgot to
                >> replace it in the example - in the base document there are no xs), the
                >> result is the same.
                >> Also, the effect is independent from enc (I tested it with both, utf8
                >> and latin1). In both cases fenc was empty.
                >
                > Well, something must be different, I still can't reproduct it.
                >
                > Can anybody else see the problem?


                I can reproduce it using Vim-7.2.1182 and the
                "spanish.txt" and "lang.vim" files posted in the
                first message of this thread.

                Here is an automated way to reproduce
                which should be easier:

                $ vim -f -g -U NONE -u NONE -i NONE --noplugin -N \
                  spanish.txt \
                  -c 'call feedkeys(":set re=1\<CR>:so lang.vim\<CR>GA abc\<Esc>k")'

                (notice that "abc" at the end of the last line has orange background)

                Now do the same but with re=2:

                $ vim -f -g -U NONE -u NONE -i NONE --noplugin -N \
                  spanish.txt \
                  -c 'call feedkeys(:set re=2\<CR>:so lang.vim\<CR>GA abc\<Esc>k")'

                (notice that "abc" has now a white background,
                which is different than before,  but press CTRL-L
                and notice that background of "abc" on last line
                becomes orange)

                Dominique

                Nope.  Orange background for both, MacVim 7.3.1168.  The second shell command is missing a double-quote right after 'feedkeys('.

                If the OP would make lang.vim contain cterm hilighting, we could test with console vim.

                -Manny 
                 

                --
                --
                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.
                 
                 
              • Dominique Pellé
                ... Valgrind finds a bug with this command (which uses re=2). That can explain why it works for some and not for others: $ valgrind vim -f -g -U NONE -u NONE
                Message 7 of 14 , Jun 12, 2013
                • 0 Attachment
                  Dominique Pellé <dominique.pelle@...> wrote:

                  > Bram Moolenaar <Bram@...> wrote:
                  >
                  >> Axel Bender wrote:
                  >>
                  >>> you may as well elimitate the inverted question mark (I just forgot to
                  >>> replace it in the example - in the base document there are no xs), the
                  >>> result is the same.
                  >>> Also, the effect is independent from enc (I tested it with both, utf8
                  >>> and latin1). In both cases fenc was empty.
                  >>
                  >> Well, something must be different, I still can't reproduct it.
                  >>
                  >> Can anybody else see the problem?
                  >
                  >
                  > I can reproduce it using Vim-7.2.1182 and the
                  > "spanish.txt" and "lang.vim" files posted in the
                  > first message of this thread.
                  >
                  > Here is an automated way to reproduce
                  > which should be easier:
                  >
                  > $ vim -f -g -U NONE -u NONE -i NONE --noplugin -N \
                  > spanish.txt \
                  > -c 'call feedkeys(":set re=1\<CR>:so lang.vim\<CR>GA abc\<Esc>k")'
                  >
                  > (notice that "abc" at the end of the last line has orange background)
                  >
                  > Now do the same but with re=2:
                  >
                  > $ vim -f -g -U NONE -u NONE -i NONE --noplugin -N \
                  > spanish.txt \
                  > -c 'call feedkeys(:set re=2\<CR>:so lang.vim\<CR>GA abc\<Esc>k")'
                  >
                  > (notice that "abc" has now a white background,
                  > which is different than before, but press CTRL-L
                  > and notice that background of "abc" on last line
                  > becomes orange)
                  >
                  > Dominique


                  Valgrind finds a bug with this command (which uses re=2).
                  That can explain why it works for some and not for others:

                  $ valgrind vim -f -g -U NONE -u NONE -i NONE --noplugin -N \
                  spanish.txt \
                  -c 'call feedkeys(":set re=2\<CR>:so lang.vim\<CR>GA abc\<Esc>k")'

                  ==10817== Invalid read of size 1
                  ==10817== at 0x4F333E: utf_ptr2char (mbyte.c:1697)
                  ==10817== by 0x54E02B: nfa_regmatch (regexp_nfa.c:5016)
                  ==10817== by 0x550A5C: nfa_regtry (regexp_nfa.c:6202)
                  ==10817== by 0x551140: nfa_regexec_both (regexp_nfa.c:6386)
                  ==10817== by 0x5515B9: nfa_regexec_multi (regexp_nfa.c:6635)
                  ==10817== by 0x5517A7: vim_regexec_multi (regexp.c:8073)
                  ==10817== by 0x59C351: syn_regexec (syntax.c:3272)
                  ==10817== by 0x599D44: syn_current_attr (syntax.c:2092)
                  ==10817== by 0x599529: get_syntax_attr (syntax.c:1851)
                  ==10817== by 0x559915: win_line (screen.c:4115)
                  ==10817== by 0x554949: win_update (screen.c:1866)
                  ==10817== by 0x551F75: update_screen (screen.c:536)
                  ==10817== by 0x5EDEEC: main_loop (main.c:1232)
                  ==10817== by 0x5EDA57: main (main.c:1020)
                  ==10817== Address 0xed2c4a1 is 1 bytes inside a block of size 69 free'd
                  ==10817== at 0x4C2A739: free (in
                  /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
                  ==10817== by 0x4E761C: vim_free (misc2.c:1744)
                  ==10817== by 0x4C584B: ml_flush_line (memline.c:3481)
                  ==10817== by 0x4C350A: ml_get_buf (memline.c:2455)
                  ==10817== by 0x53C7F9: reg_getline (regexp.c:3696)
                  ==10817== by 0x54D657: recursive_regmatch (regexp_nfa.c:4551)
                  ==10817== by 0x54E3B2: nfa_regmatch (regexp_nfa.c:5197)
                  ==10817== by 0x550A5C: nfa_regtry (regexp_nfa.c:6202)
                  ==10817== by 0x551140: nfa_regexec_both (regexp_nfa.c:6386)
                  ==10817== by 0x5515B9: nfa_regexec_multi (regexp_nfa.c:6635)
                  ==10817== by 0x5517A7: vim_regexec_multi (regexp.c:8073)
                  ==10817== by 0x59C351: syn_regexec (syntax.c:3272)
                  ==10817== by 0x599D44: syn_current_attr (syntax.c:2092)
                  ==10817== by 0x599529: get_syntax_attr (syntax.c:1851)
                  ==10817== by 0x559915: win_line (screen.c:4115)
                  ==10817== by 0x554949: win_update (screen.c:1866)
                  ==10817== by 0x551F75: update_screen (screen.c:536)
                  ==10817== by 0x5EDEEC: main_loop (main.c:1232)
                  ==10817== by 0x5EDA57: main (main.c:1020)
                  (and more error after that)

                  reginput points to free memory.

                  I don't know how to fix it yet. Maybe reginput should be
                  saved before calling recursive_regmatch(...) at line
                  regexp_nfa.c:5197 and restored afterwards?

                  Dominique

                  --
                  --
                  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 Dominique, that is very helpful. Can you please try if this patch fixes the problem: ... *************** *** 4495,4501 **** int **listids; {
                  Message 8 of 14 , Jun 13, 2013
                  • 0 Attachment
                    Dominique Pellé <dominique.pelle@...> wrote:

                    > > Bram Moolenaar <Bram@...> wrote:
                    > >
                    > >> Axel Bender wrote:
                    > >>
                    > >>> you may as well elimitate the inverted question mark (I just forgot to
                    > >>> replace it in the example - in the base document there are no xs), the
                    > >>> result is the same.
                    > >>> Also, the effect is independent from enc (I tested it with both, utf8
                    > >>> and latin1). In both cases fenc was empty.
                    > >>
                    > >> Well, something must be different, I still can't reproduct it.
                    > >>
                    > >> Can anybody else see the problem?
                    > >
                    > >
                    > > I can reproduce it using Vim-7.2.1182 and the
                    > > "spanish.txt" and "lang.vim" files posted in the
                    > > first message of this thread.
                    > >
                    > > Here is an automated way to reproduce
                    > > which should be easier:
                    > >
                    > > $ vim -f -g -U NONE -u NONE -i NONE --noplugin -N \
                    > > spanish.txt \
                    > > -c 'call feedkeys(":set re=1\<CR>:so lang.vim\<CR>GA abc\<Esc>k")'
                    > >
                    > > (notice that "abc" at the end of the last line has orange background)
                    > >
                    > > Now do the same but with re=2:
                    > >
                    > > $ vim -f -g -U NONE -u NONE -i NONE --noplugin -N \
                    > > spanish.txt \
                    > > -c 'call feedkeys(:set re=2\<CR>:so lang.vim\<CR>GA abc\<Esc>k")'
                    > >
                    > > (notice that "abc" has now a white background,
                    > > which is different than before, but press CTRL-L
                    > > and notice that background of "abc" on last line
                    > > becomes orange)
                    > >
                    > > Dominique
                    >
                    >
                    > Valgrind finds a bug with this command (which uses re=2).
                    > That can explain why it works for some and not for others:
                    >
                    > $ valgrind vim -f -g -U NONE -u NONE -i NONE --noplugin -N \
                    > spanish.txt \
                    > -c 'call feedkeys(":set re=2\<CR>:so lang.vim\<CR>GA abc\<Esc>k")'
                    >
                    > ==10817== Invalid read of size 1
                    > ==10817== at 0x4F333E: utf_ptr2char (mbyte.c:1697)
                    > ==10817== by 0x54E02B: nfa_regmatch (regexp_nfa.c:5016)
                    > ==10817== by 0x550A5C: nfa_regtry (regexp_nfa.c:6202)
                    > ==10817== by 0x551140: nfa_regexec_both (regexp_nfa.c:6386)
                    > ==10817== by 0x5515B9: nfa_regexec_multi (regexp_nfa.c:6635)
                    > ==10817== by 0x5517A7: vim_regexec_multi (regexp.c:8073)
                    > ==10817== by 0x59C351: syn_regexec (syntax.c:3272)
                    > ==10817== by 0x599D44: syn_current_attr (syntax.c:2092)
                    > ==10817== by 0x599529: get_syntax_attr (syntax.c:1851)
                    > ==10817== by 0x559915: win_line (screen.c:4115)
                    > ==10817== by 0x554949: win_update (screen.c:1866)
                    > ==10817== by 0x551F75: update_screen (screen.c:536)
                    > ==10817== by 0x5EDEEC: main_loop (main.c:1232)
                    > ==10817== by 0x5EDA57: main (main.c:1020)
                    > ==10817== Address 0xed2c4a1 is 1 bytes inside a block of size 69 free'd
                    > ==10817== at 0x4C2A739: free (in
                    > /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
                    > ==10817== by 0x4E761C: vim_free (misc2.c:1744)
                    > ==10817== by 0x4C584B: ml_flush_line (memline.c:3481)
                    > ==10817== by 0x4C350A: ml_get_buf (memline.c:2455)
                    > ==10817== by 0x53C7F9: reg_getline (regexp.c:3696)
                    > ==10817== by 0x54D657: recursive_regmatch (regexp_nfa.c:4551)
                    > ==10817== by 0x54E3B2: nfa_regmatch (regexp_nfa.c:5197)
                    > ==10817== by 0x550A5C: nfa_regtry (regexp_nfa.c:6202)
                    > ==10817== by 0x551140: nfa_regexec_both (regexp_nfa.c:6386)
                    > ==10817== by 0x5515B9: nfa_regexec_multi (regexp_nfa.c:6635)
                    > ==10817== by 0x5517A7: vim_regexec_multi (regexp.c:8073)
                    > ==10817== by 0x59C351: syn_regexec (syntax.c:3272)
                    > ==10817== by 0x599D44: syn_current_attr (syntax.c:2092)
                    > ==10817== by 0x599529: get_syntax_attr (syntax.c:1851)
                    > ==10817== by 0x559915: win_line (screen.c:4115)
                    > ==10817== by 0x554949: win_update (screen.c:1866)
                    > ==10817== by 0x551F75: update_screen (screen.c:536)
                    > ==10817== by 0x5EDEEC: main_loop (main.c:1232)
                    > ==10817== by 0x5EDA57: main (main.c:1020)
                    > (and more error after that)
                    >
                    > reginput points to free memory.
                    >
                    > I don't know how to fix it yet. Maybe reginput should be
                    > saved before calling recursive_regmatch(...) at line
                    > regexp_nfa.c:5197 and restored afterwards?

                    Thanks Dominique, that is very helpful.

                    Can you please try if this patch fixes the problem:

                    *** ../vim-7.3.1182/src/regexp_nfa.c 2013-06-11 22:44:03.000000000 +0200
                    --- src/regexp_nfa.c 2013-06-13 13:04:07.000000000 +0200
                    ***************
                    *** 4495,4501 ****
                    int **listids;
                    {
                    char_u *save_reginput = reginput;
                    - char_u *save_regline = regline;
                    int save_reglnum = reglnum;
                    int save_nfa_match = nfa_match;
                    int save_nfa_listid = nfa_listid;
                    --- 4495,4500 ----
                    ***************
                    *** 4633,4640 ****

                    /* restore position in input text */
                    reginput = save_reginput;
                    - regline = save_regline;
                    reglnum = save_reglnum;
                    nfa_match = save_nfa_match;
                    nfa_endp = save_nfa_endp;
                    nfa_listid = save_nfa_listid;
                    --- 4632,4639 ----

                    /* restore position in input text */
                    reginput = save_reginput;
                    reglnum = save_reglnum;
                    + regline = reg_getline(reglnum);
                    nfa_match = save_nfa_match;
                    nfa_endp = save_nfa_endp;
                    nfa_listid = save_nfa_listid;


                    --
                    Rule #1: Don't give somebody a tool that he's going to hurt himself with.

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