Patch 8.2.1598
Problem:    Starting a hidden terminal resizes the current window.
Solution:   Do not resize the current window for a hidden terminal.
            (closes #6872)
Files:      src/terminal.c, src/testdir/test_terminal2.vim


*** ../vim-8.2.1597/src/terminal.c      2020-09-04 18:34:06.116621660 +0200
--- src/terminal.c      2020-09-05 16:06:37.854573541 +0200
***************
*** 315,332 ****
      else if (cols != 0)
        term->tl_cols = cols;
  
!     if (term->tl_rows != curwin->w_height)
!       win_setheight_win(term->tl_rows, curwin);
!     if (term->tl_cols != curwin->w_width)
!       win_setwidth_win(term->tl_cols, curwin);
! 
!     // Set 'winsize' now to avoid a resize at the next redraw.
!     if (!minsize && *curwin->w_p_tws != NUL)
      {
!       char_u buf[100];
  
!       vim_snprintf((char *)buf, 100, "%dx%d", term->tl_rows, term->tl_cols);
!       set_option_value((char_u *)"termwinsize", 0L, buf, OPT_LOCAL);
      }
  }
  
--- 315,336 ----
      else if (cols != 0)
        term->tl_cols = cols;
  
!     if (!opt->jo_hidden)
      {
!       if (term->tl_rows != curwin->w_height)
!           win_setheight_win(term->tl_rows, curwin);
!       if (term->tl_cols != curwin->w_width)
!           win_setwidth_win(term->tl_cols, curwin);
! 
!       // Set 'winsize' now to avoid a resize at the next redraw.
!       if (!minsize && *curwin->w_p_tws != NUL)
!       {
!           char_u buf[100];
  
!           vim_snprintf((char *)buf, 100, "%dx%d",
!                                                term->tl_rows, term->tl_cols);
!           set_option_value((char_u *)"termwinsize", 0L, buf, OPT_LOCAL);
!       }
      }
  }
  
*** ../vim-8.2.1597/src/testdir/test_terminal2.vim      2020-09-04 
21:18:40.488161918 +0200
--- src/testdir/test_terminal2.vim      2020-09-05 16:05:54.754686555 +0200
***************
*** 130,135 ****
--- 130,145 ----
    set termwinsize=
  endfunc
  
+ " hidden terminal must not change current window size
+ func Test_terminal_hidden_winsize()
+   let cmd = GetDummyCmd()
+   let rows = winheight(0)
+   let buf = term_start(cmd, #{hidden: 1, term_rows: 10})
+   call assert_equal(rows, winheight(0))
+   call assert_equal([10, &columns], term_getsize(buf))
+   exe "bwipe! " .. buf
+ endfunc
+ 
  func Test_terminal_termwinkey()
    " make three tabpages, terminal in the middle
    0tabnew
*** ../vim-8.2.1597/src/version.c       2020-09-05 15:48:32.473546679 +0200
--- src/version.c       2020-09-05 16:07:24.202452229 +0200
***************
*** 756,757 ****
--- 756,759 ----
  {   /* Add new patch number below this line */
+ /**/
+     1598,
  /**/

-- 
Seen on the back of a biker's vest: If you can read this, my wife fell off.

 /// Bram Moolenaar -- [email protected] -- 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202009051409.085E9NYU617288%40masaka.moolenaar.net.

Raspunde prin e-mail lui