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

breakindentopt is not applied soon

Expand Messages
  • itchyny
    To reproduce vim -u NONE -N 500ia ^ ... set wrap breakindent set breakindentopt=shift:10 hlhlhlwbwb x Problem The indentation is not updated soon after we
    Message 1 of 11 , Jun 25, 2014
    • 0 Attachment
      To reproduce
      vim -u NONE -N
      500ia<ESC>^
      >>
      set wrap breakindent
      set breakindentopt=shift:10
      hlhlhlwbwb
      x

      Problem
      The indentation is not updated soon after we change breakindentopt.

      Expected behaviour
      The indentation is updated soon.

      Environment
      Vim 7.4 1-345

      --
      --
      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.
    • Christian Brabandt
      ... Yes, I noticed that too. diff --git a/src/misc1.c b/src/misc1.c ... +++ b/src/misc1.c @@ -513,11 +513,11 @@ get_breakindent_win(wp, line) prev_ts =
      Message 2 of 11 , Jun 25, 2014
      • 0 Attachment
        On Mi, 25 Jun 2014, itchyny wrote:

        > To reproduce
        > vim -u NONE -N
        > 500ia<ESC>^
        > >>
        > set wrap breakindent
        > set breakindentopt=shift:10
        > hlhlhlwbwb
        > x
        >
        > Problem
        > The indentation is not updated soon after we change breakindentopt.
        >
        > Expected behaviour
        > The indentation is updated soon.

        Yes, I noticed that too.

        diff --git a/src/misc1.c b/src/misc1.c
        --- a/src/misc1.c
        +++ b/src/misc1.c
        @@ -513,11 +513,11 @@ get_breakindent_win(wp, line)
        prev_ts = wp->w_buffer->b_p_ts;
        prev_tick = wp->w_buffer->b_changedtick;
        prev_indent = get_indent_str(line,
        - (int)wp->w_buffer->b_p_ts, wp->w_p_list) + wp->w_p_brishift;
        - }
        -
        + (int)wp->w_buffer->b_p_ts, wp->w_p_list);
        + }
        +
        + bri = prev_indent + wp->w_p_brishift;
        /* indent minus the length of the showbreak string */
        - bri = prev_indent;
        if (wp->w_p_brisbr)
        bri -= vim_strsize(p_sbr);


        Best,
        Christian
        --
        Der Ungläubige glaubt mehr, als er meint,
        der Gläub'ge weniger, als ihm scheint.
        -- Franz Grillparzer (Glaube)

        --
        --
        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.
      • Charles
        On Thu, Jun 26, 2014 at 4:30 AM, Christian Brabandt ... Hi, The patch doesn t seem to fix the problem. I have this settings in my vimrc
        Message 3 of 11 , Jun 25, 2014
        • 0 Attachment
          On Thu, Jun 26, 2014 at 4:30 AM, Christian Brabandt <cblists@...> wrote:

          On Mi, 25 Jun 2014, itchyny wrote:

          > To reproduce
          > vim -u NONE -N
          > 500ia<ESC>^
          > >>
          > set wrap breakindent
          > set breakindentopt=shift:10
          > hlhlhlwbwb
          > x
          >
          > Problem
          > The indentation is not updated soon after we change breakindentopt.
          >
          > Expected behaviour
          > The indentation is updated soon.

          Yes, I noticed that too.

          diff --git a/src/misc1.c b/src/misc1.c
          --- a/src/misc1.c
          +++ b/src/misc1.c
          @@ -513,11 +513,11 @@ get_breakindent_win(wp, line)
                  prev_ts = wp->w_buffer->b_p_ts;
                  prev_tick = wp->w_buffer->b_changedtick;
                  prev_indent = get_indent_str(line,
          -                 (int)wp->w_buffer->b_p_ts, wp->w_p_list) + wp->w_p_brishift;
          -    }
          -
          +                 (int)wp->w_buffer->b_p_ts, wp->w_p_list);
          +    }
          +
          +    bri = prev_indent + wp->w_p_brishift;
               /* indent minus the length of the showbreak string */
          -    bri = prev_indent;
               if (wp->w_p_brisbr)
                  bri -= vim_strsize(p_sbr);

          Hi,

          The patch doesn't seem to fix the problem.

          I have this settings in my vimrc

          set breakindent
          set breakindentopt=min:20,shift:2

          But the shift is not applied. It only get applied if I type set breakindentopt=min:20,shift:2 when editing the buffer or using an autocmd

          autocmd BufNew * set breakindentopt=min:20,shift:2,sbr

          --
          --
          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.
        • Christian Brabandt
          ... I suspect this is a different problem, because this works for me and I can t reproduce your problem. Best, Christian -- -- You received this message from
          Message 4 of 11 , Jun 25, 2014
          • 0 Attachment
            Am 2014-06-26 04:39, schrieb Charles:
            > On Thu, Jun 26, 2014 at 4:30 AM, Christian Brabandt
            > <cblists@...> wrote:
            >
            >> On Mi, 25 Jun 2014, itchyny wrote:
            >>
            >>> To reproduce
            >>> vim -u NONE -N
            >>> 500ia<ESC>^
            >>> >>
            >>> set wrap breakindent
            >>> set breakindentopt=shift:10
            >>> hlhlhlwbwb
            >>> x
            >>>
            >>> Problem
            >>> The indentation is not updated soon after we change
            >> breakindentopt.
            >>>
            >>> Expected behaviour
            >>> The indentation is updated soon.
            >>
            >> Yes, I noticed that too.
            >>
            >> diff --git a/src/misc1.c b/src/misc1.c
            >> --- a/src/misc1.c
            >> +++ b/src/misc1.c
            >> @@ -513,11 +513,11 @@ get_breakindent_win(wp, line)
            >> prev_ts = wp->w_buffer->b_p_ts;
            >> prev_tick = wp->w_buffer->b_changedtick;
            >> prev_indent = get_indent_str(line,
            >> - (int)wp->w_buffer->b_p_ts, wp->w_p_list) +
            >> wp->w_p_brishift;
            >> - }
            >> -
            >> + (int)wp->w_buffer->b_p_ts, wp->w_p_list);
            >> + }
            >> +
            >> + bri = prev_indent + wp->w_p_brishift;
            >> /* indent minus the length of the showbreak string */
            >> - bri = prev_indent;
            >> if (wp->w_p_brisbr)
            >> bri -= vim_strsize(p_sbr);
            >
            > Hi,
            >
            > The patch doesn't seem to fix the problem.
            >
            > I have this settings in my vimrc
            >
            > set breakindent
            > set breakindentopt=min:20,shift:2
            >
            > But the shift is not applied. It only get applied if I type set
            > breakindentopt=min:20,shift:2 when editing the buffer or using an
            > autocmd
            >
            > autocmd BufNew * set breakindentopt=min:20,shift:2,sbr

            I suspect this is a different problem, because this works for me and I
            can't reproduce your problem.

            Best,
            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/d/optout.
          • Charles
            On Thu, Jun 26, 2014 at 1:36 PM, Christian Brabandt ... After comparing the patch, I think the cause is the patch sent by Bram in 7.4.338
            Message 5 of 11 , Jun 26, 2014
            • 0 Attachment
              On Thu, Jun 26, 2014 at 1:36 PM, Christian Brabandt <cblists@...> wrote:
              Am 2014-06-26 04:39, schrieb Charles:

              On Thu, Jun 26, 2014 at 4:30 AM, Christian Brabandt
              <cblists@...> wrote:

              On Mi, 25 Jun 2014, itchyny wrote:

              To reproduce
              vim -u NONE -N
              500ia<ESC>^
              >>
              set wrap breakindent
              set breakindentopt=shift:10
              hlhlhlwbwb
              x

              Problem
              The indentation is not updated soon after we change
              breakindentopt.

              Expected behaviour
              The indentation is updated soon.

              Yes, I noticed that too.

              diff --git a/src/misc1.c b/src/misc1.c
              --- a/src/misc1.c
              +++ b/src/misc1.c
              @@ -513,11 +513,11 @@ get_breakindent_win(wp, line)
              prev_ts = wp->w_buffer->b_p_ts;
              prev_tick = wp->w_buffer->b_changedtick;
              prev_indent = get_indent_str(line,
              - (int)wp->w_buffer->b_p_ts, wp->w_p_list) +
              wp->w_p_brishift;
              - }
              -
              + (int)wp->w_buffer->b_p_ts, wp->w_p_list);
              + }
              +
              + bri = prev_indent + wp->w_p_brishift;
              /* indent minus the length of the showbreak string */
              - bri = prev_indent;
              if (wp->w_p_brisbr)
              bri -= vim_strsize(p_sbr);

              Hi,

              The patch doesn't seem to fix the problem.

              I have this settings in my vimrc

              set breakindent
              set breakindentopt=min:20,shift:2

              But the shift is not applied. It only get applied if I type set
              breakindentopt=min:20,shift:2 when editing the buffer or using an
              autocmd

              autocmd BufNew * set breakindentopt=min:20,shift:2,sbr

              I suspect this is a different problem, because this works for me and I
              can't reproduce your problem.

              After comparing the patch, I think the cause is the patch sent by Bram in 7.4.338 is different with your patch in github. For example patch 338 does not have wo_brishift in the window struct.

              The problem is that now it will be complicated to apply the latest patch on top of current vim source since part of it has already been merged.

              --
              --
              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.
            • Charles
              ... Hi, Attached is Christian s breakindent patch (from github) rebased to 7.4.345. -- -- You received this message from the vim_dev maillist. Do not
              Message 6 of 11 , Jun 26, 2014
              • 0 Attachment
                On Thu, Jun 26, 2014 at 2:47 PM, Charles <peacech@...> wrote:
                On Thu, Jun 26, 2014 at 1:36 PM, Christian Brabandt <cblists@...> wrote:
                Am 2014-06-26 04:39, schrieb Charles:

                On Thu, Jun 26, 2014 at 4:30 AM, Christian Brabandt
                <cblists@...> wrote:

                On Mi, 25 Jun 2014, itchyny wrote:

                To reproduce
                vim -u NONE -N
                500ia<ESC>^
                >>
                set wrap breakindent
                set breakindentopt=shift:10
                hlhlhlwbwb
                x

                Problem
                The indentation is not updated soon after we change
                breakindentopt.

                Expected behaviour
                The indentation is updated soon.

                Yes, I noticed that too.

                diff --git a/src/misc1.c b/src/misc1.c
                --- a/src/misc1.c
                +++ b/src/misc1.c
                @@ -513,11 +513,11 @@ get_breakindent_win(wp, line)
                prev_ts = wp->w_buffer->b_p_ts;
                prev_tick = wp->w_buffer->b_changedtick;
                prev_indent = get_indent_str(line,
                - (int)wp->w_buffer->b_p_ts, wp->w_p_list) +
                wp->w_p_brishift;
                - }
                -
                + (int)wp->w_buffer->b_p_ts, wp->w_p_list);
                + }
                +
                + bri = prev_indent + wp->w_p_brishift;
                /* indent minus the length of the showbreak string */
                - bri = prev_indent;
                if (wp->w_p_brisbr)
                bri -= vim_strsize(p_sbr);

                Hi,

                The patch doesn't seem to fix the problem.

                I have this settings in my vimrc

                set breakindent
                set breakindentopt=min:20,shift:2

                But the shift is not applied. It only get applied if I type set
                breakindentopt=min:20,shift:2 when editing the buffer or using an
                autocmd

                autocmd BufNew * set breakindentopt=min:20,shift:2,sbr

                I suspect this is a different problem, because this works for me and I
                can't reproduce your problem.

                After comparing the patch, I think the cause is the patch sent by Bram in 7.4.338 is different with your patch in github. For example patch 338 does not have wo_brishift in the window struct.

                The problem is that now it will be complicated to apply the latest patch on top of current vim source since part of it has already been merged.

                Hi,

                Attached is Christian's breakindent patch (from github) rebased to 7.4.345.

                --
                --
                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.
              • Christian Brabandt
                ... I am confused. Please describe clearly, what issue you see what patchlevel you have and what (extra) patch you have applied. Start with vim -u NONE -N (I
                Message 7 of 11 , Jun 26, 2014
                • 0 Attachment
                  Am 2014-06-26 11:02, schrieb Charles:
                  > Attached is Christian's breakindent patch (from github) rebased to

                  I am confused. Please describe clearly, what issue you see what
                  patchlevel you have and what
                  (extra) patch you have applied.

                  Start with vim -u NONE -N

                  (I don't think my old patch from github was any better, than what was
                  included now.)

                  I'll try to fix this then later today.

                  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/d/optout.
                • Bram Moolenaar
                  ... Thanks for the patch. -- ARTHUR: I did say sorry about the `old woman, but from the behind you looked-- DENNIS: What I object to is you automatically
                  Message 8 of 11 , Jun 26, 2014
                  • 0 Attachment
                    Christian wrote:

                    > On Mi, 25 Jun 2014, itchyny wrote:
                    >
                    > > To reproduce
                    > > vim -u NONE -N
                    > > 500ia<ESC>^
                    > > >>
                    > > set wrap breakindent
                    > > set breakindentopt=shift:10
                    > > hlhlhlwbwb
                    > > x
                    > >
                    > > Problem
                    > > The indentation is not updated soon after we change breakindentopt.
                    > >
                    > > Expected behaviour
                    > > The indentation is updated soon.
                    >
                    > Yes, I noticed that too.

                    Thanks for the patch.


                    --
                    ARTHUR: I did say sorry about the `old woman,' but from the behind you
                    looked--
                    DENNIS: What I object to is you automatically treat me like an inferior!
                    ARTHUR: Well, I AM king...
                    The Quest for the Holy Grail (Monty Python)

                    /// 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.
                  • Charles
                    On Thu, Jun 26, 2014 at 7:54 PM, Christian Brabandt ... brishift is not applied to new windows in a new tab. In the first tab, brishift=2,
                    Message 9 of 11 , Jun 26, 2014
                    • 0 Attachment
                      On Thu, Jun 26, 2014 at 7:54 PM, Christian Brabandt <cblists@...> wrote:
                      Am 2014-06-26 11:02, schrieb Charles:

                      Attached is Christian's breakindent patch (from github) rebased to

                      I am confused. Please describe clearly, what issue you see what patchlevel you have and what
                      (extra) patch you have applied.

                      Start with vim -u NONE -N

                      (I don't think my old patch from github was any better, than what was included now.)

                      I'll try to fix this then later today.

                      brishift is not applied to new windows in a new tab. In the first tab, brishift=2, if you open a new tab and debug the brishift value, it's 0

                      --
                      --
                      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.
                    • Charles
                      ... I was wrong, if I split the window, the new window brishift value is 0, while the first window is 2. -- -- You received this message from the vim_dev
                      Message 10 of 11 , Jun 26, 2014
                      • 0 Attachment
                        On Fri, Jun 27, 2014 at 8:07 AM, Charles <peacech@...> wrote:
                        On Thu, Jun 26, 2014 at 7:54 PM, Christian Brabandt <cblists@...> wrote:
                        Am 2014-06-26 11:02, schrieb Charles:

                        Attached is Christian's breakindent patch (from github) rebased to

                        I am confused. Please describe clearly, what issue you see what patchlevel you have and what
                        (extra) patch you have applied.

                        Start with vim -u NONE -N

                        (I don't think my old patch from github was any better, than what was included now.)

                        I'll try to fix this then later today.

                        brishift is not applied to new windows in a new tab. In the first tab, brishift=2, if you open a new tab and debug the brishift value, it's 0

                        I was wrong, if I split the window, the new window brishift value is 0, while the first window is 2.

                        --
                        --
                        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.
                      • Charles
                        ... I m pretty sure set_string_option is not called when copying window options, thus brishift is not applied for new window. -- -- You received this message
                        Message 11 of 11 , Jun 26, 2014
                        • 0 Attachment
                          On Fri, Jun 27, 2014 at 8:11 AM, Charles <peacech@...> wrote:
                          On Fri, Jun 27, 2014 at 8:07 AM, Charles <peacech@...> wrote:
                          On Thu, Jun 26, 2014 at 7:54 PM, Christian Brabandt <cblists@...> wrote:
                          Am 2014-06-26 11:02, schrieb Charles:

                          Attached is Christian's breakindent patch (from github) rebased to

                          I am confused. Please describe clearly, what issue you see what patchlevel you have and what
                          (extra) patch you have applied.

                          Start with vim -u NONE -N

                          (I don't think my old patch from github was any better, than what was included now.)

                          I'll try to fix this then later today.

                          brishift is not applied to new windows in a new tab. In the first tab, brishift=2, if you open a new tab and debug the brishift value, it's 0

                          I was wrong, if I split the window, the new window brishift value is 0, while the first window is 2.

                          I'm pretty sure set_string_option is not called when copying window options, thus brishift is not applied for new window.

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