Mercurial > vim
annotate src/testdir/view_util.vim @ 12170:1345621ecdfb v8.0.0965
patch 8.0.0965: not restoring cursor shape after it was set in a terminal
commit https://github.com/vim/vim/commit/3eee06e7d4c3a8e2dbb2577a1eef0e0f108e0288
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 19 19:40:50 2017 +0200
patch 8.0.0965: not restoring cursor shape after it was set in a terminal
Problem: The cursor shape is not reset after it was changed in a terminal.
Solution: Request the original cursor shape and restore it. Add t_RS.
Do not add t_SH for now, it does not work properly.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 19 Aug 2017 19:45:04 +0200 |
parents | 678edb254216 |
children | ba55861aa52c |
rev | line source |
---|---|
10843
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Functions about view shared by several tests |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 " ScreenLines(lnum, width) or |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 " ScreenLines([start, end], width) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 function! ScreenLines(lnum, width) abort |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 redraw! |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 if type(a:lnum) == v:t_list |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 let start = a:lnum[0] |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 let end = a:lnum[1] |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 else |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 let start = a:lnum |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 let end = a:lnum |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 endif |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 let lines = [] |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 for l in range(start, end) |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 let lines += [join(map(range(1, a:width), 'nr2char(screenchar(l, v:val))'), '')] |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 endfor |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 return lines |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 endfunction |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 function! NewWindow(height, width) abort |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 exe a:height . 'new' |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 exe a:width . 'vsp' |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 redraw! |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 endfunction |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 function! CloseWindow() abort |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 bw! |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 redraw! |
678edb254216
patch 8.0.0311: linebreak tests are old style
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 endfunction |