summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0522
blob: fb65c6733e01c30876d3464da6a2e3578ae2460d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0522
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0522
Problem:    :terminal does not show trailing empty lines.
Solution:   Add empty lines. (Hirohito Higashi, closes #3605)
Files:	    src/terminal.c, src/testdir/test_terminal.vim


*** ../vim-8.1.0521/src/terminal.c	2018-10-23 21:42:55.449760330 +0200
--- src/terminal.c	2018-11-11 21:52:13.823591882 +0100
***************
*** 1592,1597 ****
--- 1592,1606 ----
  	}
      }
  
+     // Add trailing empty lines.
+     for (pos.row = term->tl_scrollback.ga_len;
+ 	    pos.row < term->tl_scrollback_scrolled + term->tl_cursor_pos.row;
+ 	    ++pos.row)
+     {
+ 	if (add_empty_scrollback(term, &fill_attr, 0) == OK)
+ 	    add_scrollback_line_to_buffer(term, (char_u *)"", 0);
+     }
+ 
      term->tl_dirty_snapshot = FALSE;
  #ifdef FEAT_TIMERS
      term->tl_timer_set = FALSE;
*** ../vim-8.1.0521/src/testdir/test_terminal.vim	2018-11-03 21:47:10.949346136 +0100
--- src/testdir/test_terminal.vim	2018-11-11 21:47:20.154059795 +0100
***************
*** 1658,1660 ****
--- 1658,1682 ----
    call WaitForAssert({-> assert_false(bufexists(bnr))})
    call assert_equal(1, winnr('$'))
  endfunc
+ 
+ func Test_terminal_does_not_truncate_last_newlines()
+   let cmd = has('win32') ? 'type' : 'cat'
+   let contents = [
+   \   [ 'One', '', 'X' ],
+   \   [ 'Two', '', '' ],
+   \   [ 'Three' ] + repeat([''], 30)
+   \ ]
+ 
+   for c in contents
+     call writefile(c, 'Xfile')
+     exec 'term' cmd 'Xfile'
+     let bnr = bufnr('$')
+     call assert_equal('terminal', getbufvar(bnr, '&buftype'))
+     call WaitForAssert({-> assert_equal('finished', term_getstatus(bnr))})
+     sleep 50m
+     call assert_equal(c, getline(1, line('$')))
+     quit
+   endfor
+ 
+   call delete('Xfile')
+ endfunc
*** ../vim-8.1.0521/src/version.c	2018-11-11 21:22:53.649977524 +0100
--- src/version.c	2018-11-11 22:17:05.407532879 +0100
***************
*** 794,795 ****
--- 794,797 ----
  {   /* Add new patch number below this line */
+ /**/
+     522,
  /**/

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

 /// Bram Moolenaar -- Bram@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    ///