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

Re: Issue 120 in vim: folds are displayed incorrectly after uncaught error in try/endtry

Expand Messages
  • Christian Brabandt
    Hi Bram! ... I didn t want to add yet another variable to the win_T struct, so I made get_foldtext() check, whether the last time it run, it was still on the
    Message 1 of 9 , Mar 18, 2013
    • 0 Attachment
      Hi Bram!

      On Mi, 13 Mär 2013, Bram Moolenaar wrote:

      > What should happen is when evaluating 'foldtext' it should check if this
      > results in an error, and then stop evaluating it. Like what happens in
      > win_line() with b_syn_error. It's a bit more work, but it's probably
      > the right way to do it.
      >

      I didn't want to add yet another variable to the win_T struct, so I made
      get_foldtext() check, whether the last time it run, it was still on the
      same window and some lines before, otherwise, we at least check once,
      whether the current foldtext setting succeeds and if not, we skip
      evaluating the foldtext setting for the rest of the folds in the current
      window. (See attached patch)

      regards,
      Christian
      --

      --
      --
      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
      ... I m missing something: The original problem was triggered because emsg_off was set. But with this patch it s still set. So don t we still have the
      Message 2 of 9 , Mar 19, 2013
      • 0 Attachment
        Christian Brabandt wrote:

        > Hi Bram!
        >
        > On Mi, 13 M=E4r 2013, Bram Moolenaar wrote:
        >
        > > What should happen is when evaluating 'foldtext' it should check if this
        > > results in an error, and then stop evaluating it. Like what happens in
        > > win_line() with b_syn_error. It's a bit more work, but it's probably
        > > the right way to do it.
        > >=20
        >
        > I didn't want to add yet another variable to the win_T struct, so I made=20
        > get_foldtext() check, whether the last time it run, it was still on the=20
        > same window and some lines before, otherwise, we at least check once,=20
        > whether the current foldtext setting succeeds and if not, we skip=20
        > evaluating the foldtext setting for the rest of the folds in the current=20
        > window. (See attached patch)

        I'm missing something: The original problem was triggered because
        emsg_off was set. But with this patch it's still set. So don't we
        still have the problem with the try/catch?


        --
        hundred-and-one symptoms of being an internet addict:
        70. ISDN lines are added to your house on a hourly basis

        /// 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.
      • Christian Brabandt
        ... It temporarily reset did_emsg: + if (!got_fdt_error) + did_emsg = FALSE; /* might not yet been reset from a previous error */ regards, Christian
        Message 3 of 9 , Mar 19, 2013
        • 0 Attachment
          On Tue, March 19, 2013 11:34, Bram Moolenaar wrote:
          >
          > Christian Brabandt wrote:
          >
          >> Hi Bram!
          >>
          >> On Mi, 13 M=E4r 2013, Bram Moolenaar wrote:
          >>
          >> > What should happen is when evaluating 'foldtext' it should check if
          >> this
          >> > results in an error, and then stop evaluating it. Like what happens
          >> in
          >> > win_line() with b_syn_error. It's a bit more work, but it's probably
          >> > the right way to do it.
          >> >=20
          >>
          >> I didn't want to add yet another variable to the win_T struct, so I
          >> made=20
          >> get_foldtext() check, whether the last time it run, it was still on
          >> the=20
          >> same window and some lines before, otherwise, we at least check once,=20
          >> whether the current foldtext setting succeeds and if not, we skip=20
          >> evaluating the foldtext setting for the rest of the folds in the
          >> current=20
          >> window. (See attached patch)
          >
          > I'm missing something: The original problem was triggered because
          > emsg_off was set. But with this patch it's still set. So don't we
          > still have the problem with the try/catch?
          >
          It temporarily reset did_emsg:
          + if (!got_fdt_error)
          + did_emsg = FALSE; /* might not yet been reset from a previous
          error */


          regards,
          Christian

          --
          --
          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
          ... Unless I m missing something, that is not enough. In emsg() there is a check for emsg_off (in emsg_not_now()), and if emsg_off is set then it doesn t get
          Message 4 of 9 , Mar 19, 2013
          • 0 Attachment
            Christian Brabandt wrote:

            > >> Hi Bram!
            > >>
            > >> On Mi, 13 M=E4r 2013, Bram Moolenaar wrote:
            > >>
            > >> > What should happen is when evaluating 'foldtext' it should check if
            > >> this
            > >> > results in an error, and then stop evaluating it. Like what happens
            > >> in
            > >> > win_line() with b_syn_error. It's a bit more work, but it's probably
            > >> > the right way to do it.
            > >> >=20
            > >>
            > >> I didn't want to add yet another variable to the win_T struct, so I
            > >> made=20
            > >> get_foldtext() check, whether the last time it run, it was still on
            > >> the=20
            > >> same window and some lines before, otherwise, we at least check once,=20
            > >> whether the current foldtext setting succeeds and if not, we skip=20
            > >> evaluating the foldtext setting for the rest of the folds in the
            > >> current=20
            > >> window. (See attached patch)
            > >
            > > I'm missing something: The original problem was triggered because
            > > emsg_off was set. But with this patch it's still set. So don't we
            > > still have the problem with the try/catch?
            > >
            > It temporarily reset did_emsg:
            > + if (!got_fdt_error)
            > + did_emsg = FALSE; /* might not yet been reset from a previous
            > error */

            Unless I'm missing something, that is not enough. In emsg() there is a
            check for emsg_off (in emsg_not_now()), and if emsg_off is set then it
            doesn't get to throwing an exception.

            --
            hundred-and-one symptoms of being an internet addict:
            72. Somebody at IRC just mentioned a way to obtain full motion video without
            a PC using a wireless protocol called NTSC, you wonder how you never
            heard about it

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