Patch 8.0.1714
Problem:    Term_setsize() does not give an error in a normal buffer.
Solution:   Add an error message.
Files:      src/terminal.c, src/testdir/test_terminal.vim


*** ../vim-8.0.1713/src/terminal.c      2018-04-14 18:13:44.371164679 +0200
--- src/terminal.c      2018-04-14 21:31:24.912339349 +0200
***************
*** 4629,4635 ****
      term_T    *term;
      varnumber_T rows, cols;
  
!     if (buf == NULL || buf->b_term->tl_vterm == NULL)
        return;
      term = buf->b_term;
      rows = get_tv_number(&argvars[1]);
--- 4629,4640 ----
      term_T    *term;
      varnumber_T rows, cols;
  
!     if (buf == NULL)
!     {
!       EMSG(_("E955: Not a terminal buffer"));
!       return;
!     }
!     if (buf->b_term->tl_vterm == NULL)
        return;
      term = buf->b_term;
      rows = get_tv_number(&argvars[1]);
*** ../vim-8.0.1713/src/testdir/test_terminal.vim       2018-04-14 
17:05:29.787581114 +0200
--- src/testdir/test_terminal.vim       2018-04-14 21:27:13.041746448 +0200
***************
*** 271,276 ****
--- 271,297 ----
    call delete('Xtext')
  endfunc
  
+ func Test_terminal_scrollback()
+   let buf = Run_shell_in_terminal({})
+   set terminalscroll=100
+   call writefile(range(150), 'Xtext')
+   if has('win32')
+     call term_sendkeys(buf, "type Xtext\<CR>")
+   else
+     call term_sendkeys(buf, "cat Xtext\<CR>")
+   endif
+   let rows = term_getsize(buf)[0]
+   call WaitFor({-> term_getline(buf, rows - 1) =~ '149'})
+   let lines = line('$')
+   call assert_true(lines <= 100)
+   call assert_true(lines > 90)
+ 
+   call Stop_shell_in_terminal(buf)
+   call term_wait(buf)
+   exe buf . 'bwipe'
+   set terminalscroll&
+ endfunc
+ 
  func Test_terminal_size()
    let cmd = Get_cat_123_cmd()
  
***************
*** 298,303 ****
--- 319,325 ----
    call assert_equal([7, 30], term_getsize(''))
  
    bwipe!
+   call assert_fails("call term_setsize('', 7, 30)", "E955:")
  
    call term_start(cmd, {'term_rows': 6, 'term_cols': 36})
    let size = term_getsize('')
*** ../vim-8.0.1713/src/version.c       2018-04-14 18:59:45.932174933 +0200
--- src/version.c       2018-04-14 21:28:04.317473722 +0200
***************
*** 764,765 ****
--- 764,767 ----
  {   /* Add new patch number below this line */
+ /**/
+     1714,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
178. You look for an icon to double-click to open your bedroom window.

 /// Bram Moolenaar -- b...@moolenaar.net -- 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui