Mercurial > vim
comparison src/testdir/test_man.vim @ 17541:d9aa921b7198 v8.1.1768
patch 8.1.1768: man plugin changes setting in current window
commit https://github.com/vim/vim/commit/bca9c301936c9ba4ee67528f81393debf83844b9
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 28 15:28:45 2019 +0200
patch 8.1.1768: man plugin changes setting in current window
Problem: Man plugin changes setting in current window.
Solution: Set options later. (Jason Franklin)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 28 Jul 2019 15:30:05 +0200 |
parents | d2a834aa7cc0 |
children | 18043e7ab449 |
comparison
equal
deleted
inserted
replaced
17540:63ae37bd4cfd | 17541:d9aa921b7198 |
---|---|
1 runtime ftplugin/man.vim | 1 runtime ftplugin/man.vim |
2 | 2 |
3 function Test_g_ft_man_open_mode() | 3 func Test_g_ft_man_open_mode() |
4 vnew | 4 vnew |
5 let l:h = winheight(1) | 5 let l:h = winheight(1) |
6 q | 6 q |
7 let l:w = winwidth(1) | 7 let l:w = winwidth(1) |
8 | 8 |
46 call assert_equal(2, tabpagenr('$')) | 46 call assert_equal(2, tabpagenr('$')) |
47 call assert_equal(2, tabpagenr()) | 47 call assert_equal(2, tabpagenr()) |
48 q | 48 q |
49 | 49 |
50 unlet g:ft_man_open_mode | 50 unlet g:ft_man_open_mode |
51 endfunction | 51 endfunc |
52 | 52 |
53 function Test_nomodifiable() | 53 func Test_nomodifiable() |
54 let wincnt = winnr('$') | 54 let wincnt = winnr('$') |
55 Man vim | 55 Man vim |
56 if wincnt == winnr('$') | 56 if wincnt == winnr('$') |
57 " Vim manual page cannot be found. | 57 " Vim manual page cannot be found. |
58 return | 58 return |
59 endif | 59 endif |
60 call assert_false(&l:modifiable) | 60 call assert_false(&l:modifiable) |
61 q | 61 q |
62 endfunction | 62 endfunc |
63 | 63 |
64 function Test_buffer_count_hidden() | 64 func Test_buffer_count_hidden() |
65 %bw! | 65 %bw! |
66 set hidden | 66 set hidden |
67 | 67 |
68 call assert_equal(1, len(getbufinfo())) | 68 call assert_equal(1, len(getbufinfo())) |
69 | 69 |
83 call assert_equal(1, len(getbufinfo({'buflisted':1}))) | 83 call assert_equal(1, len(getbufinfo({'buflisted':1}))) |
84 call assert_equal(2, len(getbufinfo())) | 84 call assert_equal(2, len(getbufinfo())) |
85 q | 85 q |
86 | 86 |
87 set hidden& | 87 set hidden& |
88 endfunction | 88 endfunc |
89 | |
90 " Check that we do not alter the settings in the initial window. | |
91 func Test_local_options() | |
92 %bw! | |
93 set foldcolumn=1 number | |
94 | |
95 let wincnt = winnr('$') | |
96 Man vim | |
97 if wincnt == winnr('$') | |
98 " Vim manual page cannot be found. | |
99 return | |
100 endif | |
101 | |
102 " man page | |
103 call assert_false(&nu) | |
104 call assert_equal(0, &fdc) | |
105 | |
106 " initial window | |
107 wincmd p | |
108 call assert_true(&nu) | |
109 call assert_equal(1, &fdc) | |
110 | |
111 %bw! | |
112 set foldcolumn& number& | |
113 endfunc |