annotate runtime/autoload/dist/man.vim @ 29328:60977de70684 v9.0.0007

patch 9.0.0007: no support for double, dotted and dashed underlines Commit: https://github.com/vim/vim/commit/84f546363068e4ddfe14a8a2a2322bb8d3a25417 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jun 29 18:39:11 2022 +0100 patch 9.0.0007: no support for double, dotted and dashed underlines Problem: No support for double, dotted and dashed underlines. Solution: Add the termcap entries and highlight modes. (closes https://github.com/vim/vim/issues/9553)
author Bram Moolenaar <Bram@vim.org>
date Wed, 29 Jun 2022 19:45:03 +0200
parents 0eef32b4ebbc
children f0854888250f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29236
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Vim filetype plugin autoload file
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 " Language: man
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " Maintainer: Jason Franklin <vim@justemail.net>
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 " Maintainer: SungHyun Nam <goweol@gmail.com>
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 " Autoload Split: Bram Moolenaar
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 " Last Change: 2022 Jun 18
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 let s:cpo_save = &cpo
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9 set cpo-=C
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 let s:man_tag_depth = 0
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13 let s:man_sect_arg = ""
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 let s:man_find_arg = "-w"
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 try
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 if !has("win32") && $OSTYPE !~ 'cygwin\|linux' && system('uname -s') =~ "SunOS" && system('uname -r') =~ "^5"
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 let s:man_sect_arg = "-s"
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 let s:man_find_arg = "-l"
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20 catch /E145:/
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 " Ignore the error in restricted mode
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 endtry
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 func dist#man#PreGetPage(cnt)
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 if a:cnt == 0
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 let old_isk = &iskeyword
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 if &ft == 'man'
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 setl iskeyword+=(,)
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 let str = expand("<cword>")
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 let &l:iskeyword = old_isk
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 let page = substitute(str, '(*\(\k\+\).*', '\1', '')
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 let sect = substitute(str, '\(\k\+\)(\([^()]*\)).*', '\2', '')
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 if match(sect, '^[0-9 ]\+$') == -1
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 let sect = ""
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 if sect == page
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 let sect = ""
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 else
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41 let sect = a:cnt
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42 let page = expand("<cword>")
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 call dist#man#GetPage('', sect, page)
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 endfunc
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47 func s:GetCmdArg(sect, page)
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 if empty(a:sect)
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 return shellescape(a:page)
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 return s:man_sect_arg . ' ' . shellescape(a:sect) . ' ' . shellescape(a:page)
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54 endfunc
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 func s:FindPage(sect, page)
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 let l:cmd = printf('man %s %s', s:man_find_arg, s:GetCmdArg(a:sect, a:page))
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58 call system(l:cmd)
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60 if v:shell_error
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61 return 0
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64 return 1
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
65 endfunc
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
66
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
67 func dist#man#GetPage(cmdmods, ...)
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
68 if a:0 >= 2
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
69 let sect = a:1
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
70 let page = a:2
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
71 elseif a:0 >= 1
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
72 let sect = ""
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
73 let page = a:1
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
74 else
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
75 return
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
76 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
77
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
78 " To support: nmap K :Man <cword>
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
79 if page == '<cword>'
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
80 let page = expand('<cword>')
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
81 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
82
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
83 if !exists('g:ft_man_no_sect_fallback') || (g:ft_man_no_sect_fallback == 0)
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
84 if sect != "" && s:FindPage(sect, page) == 0
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
85 let sect = ""
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
86 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
87 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
88 if s:FindPage(sect, page) == 0
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
89 let msg = 'man.vim: no manual entry for "' . page . '"'
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
90 if !empty(sect)
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
91 let msg .= ' in section ' . sect
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
92 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
93 echomsg msg
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
94 return
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
95 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
96 exec "let s:man_tag_buf_".s:man_tag_depth." = ".bufnr("%")
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
97 exec "let s:man_tag_lin_".s:man_tag_depth." = ".line(".")
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
98 exec "let s:man_tag_col_".s:man_tag_depth." = ".col(".")
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
99 let s:man_tag_depth = s:man_tag_depth + 1
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
100
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
101 let open_cmd = 'edit'
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
102
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
103 " Use an existing "man" window if it exists, otherwise open a new one.
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
104 if &filetype != "man"
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
105 let thiswin = winnr()
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
106 exe "norm! \<C-W>b"
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
107 if winnr() > 1
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
108 exe "norm! " . thiswin . "\<C-W>w"
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
109 while 1
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
110 if &filetype == "man"
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
111 break
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
112 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
113 exe "norm! \<C-W>w"
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
114 if thiswin == winnr()
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
115 break
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
116 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
117 endwhile
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
118 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
119 if &filetype != "man"
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
120 if exists("g:ft_man_open_mode")
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
121 if g:ft_man_open_mode == 'vert'
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
122 let open_cmd = 'vsplit'
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
123 elseif g:ft_man_open_mode == 'tab'
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
124 let open_cmd = 'tabedit'
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
125 else
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
126 let open_cmd = 'split'
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
127 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
128 else
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
129 let open_cmd = a:cmdmods . ' split'
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
130 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
131 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
132 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
133
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
134 silent execute open_cmd . " $HOME/" . page . '.' . sect . '~'
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
135
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
136 " Avoid warning for editing the dummy file twice
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
137 setl buftype=nofile noswapfile
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
138
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
139 setl fdc=0 ma nofen nonu nornu
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
140 %delete _
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
141 let unsetwidth = 0
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
142 if empty($MANWIDTH)
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
143 let $MANWIDTH = winwidth(0)
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
144 let unsetwidth = 1
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
145 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
146
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
147 " Ensure Vim is not recursively invoked (man-db does this) when doing ctrl-[
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
148 " on a man page reference by unsetting MANPAGER.
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
149 " Some versions of env(1) do not support the '-u' option, and in such case
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
150 " we set MANPAGER=cat.
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
151 if !exists('s:env_has_u')
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
152 call system('env -u x true')
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
153 let s:env_has_u = (v:shell_error == 0)
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
154 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
155 let env_cmd = s:env_has_u ? 'env -u MANPAGER' : 'env MANPAGER=cat'
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
156 let env_cmd .= ' GROFF_NO_SGR=1'
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
157 let man_cmd = env_cmd . ' man ' . s:GetCmdArg(sect, page) . ' | col -b'
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
158 silent exec "r !" . man_cmd
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
159
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
160 if unsetwidth
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
161 let $MANWIDTH = ''
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
162 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
163 " Remove blank lines from top and bottom.
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
164 while line('$') > 1 && getline(1) =~ '^\s*$'
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
165 1delete _
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
166 endwhile
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
167 while line('$') > 1 && getline('$') =~ '^\s*$'
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
168 $delete _
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
169 endwhile
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
170 1
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
171 setl ft=man nomod
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
172 setl bufhidden=hide
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
173 setl nobuflisted
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
174 setl noma
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
175 endfunc
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
176
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
177 func dist#man#PopPage()
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
178 if s:man_tag_depth > 0
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
179 let s:man_tag_depth = s:man_tag_depth - 1
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
180 exec "let s:man_tag_buf=s:man_tag_buf_".s:man_tag_depth
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
181 exec "let s:man_tag_lin=s:man_tag_lin_".s:man_tag_depth
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
182 exec "let s:man_tag_col=s:man_tag_col_".s:man_tag_depth
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
183 exec s:man_tag_buf."b"
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
184 exec s:man_tag_lin
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
185 exec "norm! ".s:man_tag_col."|"
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
186 exec "unlet s:man_tag_buf_".s:man_tag_depth
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
187 exec "unlet s:man_tag_lin_".s:man_tag_depth
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
188 exec "unlet s:man_tag_col_".s:man_tag_depth
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
189 unlet s:man_tag_buf s:man_tag_lin s:man_tag_col
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
190 endif
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
191 endfunc
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
192
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
193 let &cpo = s:cpo_save
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
194 unlet s:cpo_save
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
195
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
196 " vim: set sw=2 ts=8 noet: