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

Patch 7.4.372

Expand Messages
  • Bram Moolenaar
    Patch 7.4.372 Problem: When winminheight is zero there might not be one line for the current window. Solution: Change the size computations. (Yukihiro
    Message 1 of 7 , Jul 16, 2014
    • 0 Attachment
      Patch 7.4.372
      Problem: When 'winminheight' is zero there might not be one line for the
      current window.
      Solution: Change the size computations. (Yukihiro Nakadaira)
      Files: src/window.c


      *** ../vim-7.4.371/src/window.c 2014-07-16 16:30:21.647608710 +0200
      --- src/window.c 2014-07-16 18:06:53.123491001 +0200
      ***************
      *** 688,693 ****
      --- 688,695 ----
      int before;
      int minwidth;
      int minheight;
      + int wmw1;
      + int wmh1;

      if (flags & WSP_TOP)
      oldwin = firstwin;
      ***************
      *** 722,740 ****
      * Check if we are able to split the current window and compute its
      * width.
      */
      ! needed = p_wmw + 1;
      if (flags & WSP_ROOM)
      ! needed += p_wiw - p_wmw;
      if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
      {
      ! minwidth = frame_minwidth(topframe, NULL);
      available = topframe->fr_width;
      needed += minwidth;
      }
      else
      {
      ! minwidth = frame_minwidth(oldwin->w_frame, NULL);
      ! available = oldwin->w_width;
      }
      if (available < needed && new_wp == NULL)
      {
      --- 724,745 ----
      * Check if we are able to split the current window and compute its
      * width.
      */
      ! /* Current window requires at least 1 space. */
      ! wmw1 = (p_wmw == 0 ? 1 : p_wmw);
      ! needed = wmw1 + 1;
      if (flags & WSP_ROOM)
      ! needed += p_wiw - wmw1;
      if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
      {
      ! minwidth = frame_minwidth(topframe, NOWIN);
      available = topframe->fr_width;
      needed += minwidth;
      }
      else
      {
      ! minwidth = frame_minwidth(oldwin->w_frame, NOWIN);
      ! available = oldwin->w_frame->fr_width;
      ! needed += minwidth;
      }
      if (available < needed && new_wp == NULL)
      {
      ***************
      *** 743,754 ****
      }
      if (new_size == 0)
      new_size = oldwin->w_width / 2;
      - if (new_size > oldwin->w_width - p_wmw - 1)
      - new_size = oldwin->w_width - p_wmw - 1;
      if (new_size > available - minwidth - 1)
      new_size = available - minwidth - 1;
      ! if (new_size < p_wmw)
      ! new_size = p_wmw;

      /* if it doesn't fit in the current window, need win_equal() */
      if (oldwin->w_width - new_size - 1 < p_wmw)
      --- 748,757 ----
      }
      if (new_size == 0)
      new_size = oldwin->w_width / 2;
      if (new_size > available - minwidth - 1)
      new_size = available - minwidth - 1;
      ! if (new_size < wmw1)
      ! new_size = wmw1;

      /* if it doesn't fit in the current window, need win_equal() */
      if (oldwin->w_width - new_size - 1 < p_wmw)
      ***************
      *** 789,808 ****
      * Check if we are able to split the current window and compute its
      * height.
      */
      ! needed = p_wmh + STATUS_HEIGHT + need_status;
      if (flags & WSP_ROOM)
      ! needed += p_wh - p_wmh;
      if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
      {
      ! minheight = frame_minheight(topframe, NULL);
      available = topframe->fr_height;
      needed += minheight;
      }
      else
      {
      ! minheight = frame_minheight(oldwin->w_frame, NULL);
      ! available = oldwin->w_height;
      ! needed += p_wmh;
      }
      if (available < needed && new_wp == NULL)
      {
      --- 792,813 ----
      * Check if we are able to split the current window and compute its
      * height.
      */
      ! /* Current window requires at least 1 space. */
      ! wmh1 = (p_wmh == 0 ? 1 : p_wmh);
      ! needed = wmh1 + STATUS_HEIGHT;
      if (flags & WSP_ROOM)
      ! needed += p_wh - wmh1;
      if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
      {
      ! minheight = frame_minheight(topframe, NOWIN) + need_status;
      available = topframe->fr_height;
      needed += minheight;
      }
      else
      {
      ! minheight = frame_minheight(oldwin->w_frame, NOWIN) + need_status;
      ! available = oldwin->w_frame->fr_height;
      ! needed += minheight;
      }
      if (available < needed && new_wp == NULL)
      {
      ***************
      *** 817,829 ****
      }
      if (new_size == 0)
      new_size = oldwin_height / 2;
      -
      - if (new_size > oldwin_height - p_wmh - STATUS_HEIGHT)
      - new_size = oldwin_height - p_wmh - STATUS_HEIGHT;
      if (new_size > available - minheight - STATUS_HEIGHT)
      new_size = available - minheight - STATUS_HEIGHT;
      ! if (new_size < p_wmh)
      ! new_size = p_wmh;

      /* if it doesn't fit in the current window, need win_equal() */
      if (oldwin_height - new_size - STATUS_HEIGHT < p_wmh)
      --- 822,831 ----
      }
      if (new_size == 0)
      new_size = oldwin_height / 2;
      if (new_size > available - minheight - STATUS_HEIGHT)
      new_size = available - minheight - STATUS_HEIGHT;
      ! if (new_size < wmh1)
      ! new_size = wmh1;

      /* if it doesn't fit in the current window, need win_equal() */
      if (oldwin_height - new_size - STATUS_HEIGHT < p_wmh)
      *** ../vim-7.4.371/src/version.c 2014-07-16 17:29:46.691536252 +0200
      --- src/version.c 2014-07-16 17:34:14.795530803 +0200
      ***************
      *** 736,737 ****
      --- 736,739 ----
      { /* Add new patch number below this line */
      + /**/
      + 372,
      /**/

      --
      [The rest of the ARMY stand around looking at a loss.]
      INSPECTOR END OF FILM: (picks up megaphone) All right! Clear off! Go on!
      "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

      /// 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.
    • Yukihiro Nakadaira
      ... I m sorry, this patch have a bug. Please revert for now. $ vim -u NONE -N ... E36: Not enough room Expected: split the window -- Yukihiro Nakadaira -
      Message 2 of 7 , Jul 16, 2014
      • 0 Attachment
        On Thu, Jul 17, 2014 at 1:19 AM, Bram Moolenaar <Bram@...> wrote:

        Patch 7.4.372
        Problem:    When 'winminheight' is zero there might not be one line for the
                    current window.
        Solution:   Change the size computations. (Yukihiro Nakadaira)
        Files:      src/window.c

        I'm sorry, this patch have a bug.  Please revert for now.

        $ vim -u NONE -N
        :set winminwidth=0 winminheight=0
        :while 1 | split | endwhile
        :topleft vsplit
        :split
        E36: Not enough room
        Expected: split the window

        --
        Yukihiro Nakadaira - yukihiro.nakadaira@...

        --
        --
        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.
      • Yukihiro Nakadaira
        On Thu, Jul 17, 2014 at 1:38 AM, Yukihiro Nakadaira
        Message 3 of 7 , Jul 16, 2014
        • 0 Attachment
          On Thu, Jul 17, 2014 at 1:38 AM, Yukihiro Nakadaira <yukihiro.nakadaira@...> wrote:

          On Thu, Jul 17, 2014 at 1:19 AM, Bram Moolenaar <Bram@...> wrote:

          Patch 7.4.372
          Problem:    When 'winminheight' is zero there might not be one line for the
                      current window.
          Solution:   Change the size computations. (Yukihiro Nakadaira)
          Files:      src/window.c

          I'm sorry, this patch have a bug.  Please revert for now.

          $ vim -u NONE -N
          :set winminwidth=0 winminheight=0
          :while 1 | split | endwhile
          :topleft vsplit
          :split
          E36: Not enough room
          Expected: split the window

          I'm sorry, this behavior is not due to this patch.  This seems original behavior.  hmm...

          --
          Yukihiro Nakadaira - yukihiro.nakadaira@...

          --
          --
          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.
        • Yukihiro Nakadaira
          On Thu, Jul 17, 2014 at 1:53 AM, Yukihiro Nakadaira
          Message 4 of 7 , Jul 16, 2014
          • 0 Attachment
            On Thu, Jul 17, 2014 at 1:53 AM, Yukihiro Nakadaira <yukihiro.nakadaira@...> wrote:
            On Thu, Jul 17, 2014 at 1:38 AM, Yukihiro Nakadaira <yukihiro.nakadaira@...> wrote:

            On Thu, Jul 17, 2014 at 1:19 AM, Bram Moolenaar <Bram@...> wrote:

            Patch 7.4.372
            Problem:    When 'winminheight' is zero there might not be one line for the
                        current window.
            Solution:   Change the size computations. (Yukihiro Nakadaira)
            Files:      src/window.c

            I'm sorry, this patch have a bug.  Please revert for now.

            $ vim -u NONE -N
            :set winminwidth=0 winminheight=0
            :while 1 | split | endwhile
            :topleft vsplit
            :split
            E36: Not enough room
            Expected: split the window

            I'm sorry, this behavior is not due to this patch.  This seems original behavior.  hmm...

            With or without this patch, split will fail when 'winminheight' is non-zero.

            $ vim -u NONE -N
            :set winminheight=1
            :while 1 | split | endwhile
            :topleft vsplit
            :split
            E36: Not enough room

            --
            Yukihiro Nakadaira - yukihiro.nakadaira@...

            --
            --
            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
            ... I ll add it on the todo list. -- I love deadlines. I especially like the whooshing sound they make as they go flying by. -- Douglas Adams /// Bram
            Message 5 of 7 , Jul 16, 2014
            • 0 Attachment
              Yukihiro Nakadaira wrote:

              > --047d7bdc801adb733f04fe52c63e
              > Content-Type: text/plain; charset=UTF-8
              >
              > On Thu, Jul 17, 2014 at 1:53 AM, Yukihiro Nakadaira <
              > yukihiro.nakadaira@...> wrote:
              >
              > > On Thu, Jul 17, 2014 at 1:38 AM, Yukihiro Nakadaira <
              > > yukihiro.nakadaira@...> wrote:
              > >
              > >>
              > >> On Thu, Jul 17, 2014 at 1:19 AM, Bram Moolenaar <Bram@...>
              > >> wrote:
              > >>
              > >>>
              > >>> Patch 7.4.372
              > >>> Problem: When 'winminheight' is zero there might not be one line for
              > >>> the
              > >>> current window.
              > >>> Solution: Change the size computations. (Yukihiro Nakadaira)
              > >>> Files: src/window.c
              > >>>
              > >>
              > >> I'm sorry, this patch have a bug. Please revert for now.
              > >>
              > >> $ vim -u NONE -N
              > >> :set winminwidth=0 winminheight=0
              > >> :while 1 | split | endwhile
              > >> :topleft vsplit
              > >> :split
              > >> E36: Not enough room
              > >> Expected: split the window
              > >>
              > >
              > > I'm sorry, this behavior is not due to this patch. This seems original
              > > behavior. hmm...
              > >
              >
              > With or without this patch, split will fail when 'winminheight' is non-zero.
              >
              > $ vim -u NONE -N
              > :set winminheight=1
              > :while 1 | split | endwhile
              > :topleft vsplit
              > :split
              > E36: Not enough room

              I'll add it on the todo list.

              --
              "I love deadlines. I especially like the whooshing sound they
              make as they go flying by."
              -- Douglas Adams

              /// 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.
            • Yukihiro Nakadaira
              ... I wrote patch for this problem. Please check the attached patch. -- Yukihiro Nakadaira - yukihiro.nakadaira@gmail.com -- -- You received this message from
              Message 6 of 7 , Jul 17, 2014
              • 0 Attachment
                On Thu, Jul 17, 2014 at 6:32 AM, Bram Moolenaar <Bram@...> wrote:

                Yukihiro Nakadaira wrote:

                > --047d7bdc801adb733f04fe52c63e
                > Content-Type: text/plain; charset=UTF-8
                >
                > On Thu, Jul 17, 2014 at 1:53 AM, Yukihiro Nakadaira <
                > yukihiro.nakadaira@...> wrote:
                >
                > > On Thu, Jul 17, 2014 at 1:38 AM, Yukihiro Nakadaira <
                > > yukihiro.nakadaira@...> wrote:
                > >
                > >>
                > >> On Thu, Jul 17, 2014 at 1:19 AM, Bram Moolenaar <Bram@...>
                > >> wrote:
                > >>
                > >>>
                > >>> Patch 7.4.372
                > >>> Problem:    When 'winminheight' is zero there might not be one line for
                > >>> the
                > >>>             current window.
                > >>> Solution:   Change the size computations. (Yukihiro Nakadaira)
                > >>> Files:      src/window.c
                > >>>
                > >>
                > >> I'm sorry, this patch have a bug.  Please revert for now.
                > >>
                > >> $ vim -u NONE -N
                > >> :set winminwidth=0 winminheight=0
                > >> :while 1 | split | endwhile
                > >> :topleft vsplit
                > >> :split
                > >> E36: Not enough room
                > >> Expected: split the window
                > >>
                > >
                > > I'm sorry, this behavior is not due to this patch.  This seems original
                > > behavior.  hmm...
                > >
                >
                > With or without this patch, split will fail when 'winminheight' is non-zero.
                >
                > $ vim -u NONE -N
                > :set winminheight=1
                > :while 1 | split | endwhile
                > :topleft vsplit
                > :split
                > E36: Not enough room

                I'll add it on the todo list.

                I wrote patch for this problem.  Please check the attached patch.

                --
                Yukihiro Nakadaira - yukihiro.nakadaira@...

                --
                --
                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! -- NEIL INNES PLAYED: THE FIRST SELF-DESTRUCTIVE MONK, ROBIN S LEAST FAVORITE MINSTREL, THE PAGE CRUSHED BY A RABBIT, THE OWNER OF A DUCK Monty
                Message 7 of 7 , Jul 17, 2014
                • 0 Attachment
                  Yukihiro Nakadaira wrote:

                  > > > With or without this patch, split will fail when 'winminheight' is
                  > > > non-zero.
                  > > >
                  > > > $ vim -u NONE -N
                  > > > :set winminheight=1
                  > > > :while 1 | split | endwhile
                  > > > :topleft vsplit
                  > > > :split
                  > > > E36: Not enough room
                  > >
                  > > I'll add it on the todo list.
                  >
                  > I wrote patch for this problem. Please check the attached patch.

                  Thanks!


                  --
                  NEIL INNES PLAYED: THE FIRST SELF-DESTRUCTIVE MONK, ROBIN'S LEAST FAVORITE
                  MINSTREL, THE PAGE CRUSHED BY A RABBIT, THE OWNER OF A DUCK
                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

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