annotate runtime/ftplugin/pod.vim @ 30156:d58331e0f14a v9.0.0414

patch 9.0.0414: matchstr() still does not match column offset Commit: https://github.com/vim/vim/commit/753aead960f163d0d3f8ce523ea523f2e0cec06d Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 8 12:17:06 2022 +0100 patch 9.0.0414: matchstr() still does not match column offset Problem: matchstr() still does not match column offset when done after a text search. Solution: Only use the line number for a multi-line search. Fix the test. (closes #10938)
author Bram Moolenaar <Bram@vim.org>
date Thu, 08 Sep 2022 13:30:03 +0200
parents d1fe80fb35e6
children d84610677553
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Vim filetype plugin file
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 " Language: Perl POD format
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " Maintainer: vim-perl <vim-perl@googlegroups.com>
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 " Author: Doug Kearns <dougkearns@gmail.com>
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 " Homepage: https://github.com/vim-perl/vim-perl
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 " Bugs/requests: https://github.com/vim-perl/vim-perl/issues
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 " License: Vim License (see :help license)
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 " Last Change: 2021 Oct 19
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10 if exists("b:did_ftplugin")
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 finish
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 endif
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 let s:save_cpo = &cpo
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 set cpo-=C
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 setlocal comments=fb:=for\ comment
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 setlocal commentstring==for\ comment\ %s
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20 let b:undo_ftplugin = "setl com< cms<"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 if exists("loaded_matchit") && !exists("b:match_words")
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 let b:match_words =
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 \ '^=pod\>:^=cut\>,' .
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 \ '^=begin\s\+\(\S\+\):^=end\s\+\1,' .
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 \ '^=over\>:^=item\>:^=back\>,' .
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 \ '[IBCLEFSXZ]<<\%(\s\+\|$\)\@=:\%(\s\+\|^\)\@<=>>,' .
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 \ '[IBCLEFSXZ]<:>'
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 let b:undo_ftplugin .= " | unlet! b:match_words"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 endif
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 let b:browsefilter = "POD Source Files (*.pod)\t*.pod\n" .
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 \ "Perl Source Files (*.pl)\t*.pl\n" .
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 \ "Perl Modules (*.pm)\t*.pm\n" .
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 \ "All Files (*.*)\t*.*\n"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 let b:undo_ftplugin .= " | unlet! b:browsefilter"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 endif
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 function! s:jumpToSection(backwards)
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41 let flags = a:backwards ? 'bsWz' : 'sWz'
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42 if has('syntax_items')
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 let skip = "synIDattr(synID(line('.'), col('.'), 1), 'name') !~# '\\<podCommand\\>'"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 else
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 let skip = ''
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 endif
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47 for i in range(v:count1)
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48 call search('^=\a', flags, 0, 0, skip)
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 endfor
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 endfunction
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52 if !exists("no_plugin_maps") && !exists("no_pod_maps")
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 nnoremap <silent> <buffer> ]] <Cmd>call <SID>jumpToSection()<CR>
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54 vnoremap <silent> <buffer> ]] <Cmd>call <SID>jumpToSection()<CR>
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 nnoremap <silent> <buffer> ][ <Cmd>call <SID>jumpToSection()<CR>
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 vnoremap <silent> <buffer> ][ <Cmd>call <SID>jumpToSection()<CR>
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 nnoremap <silent> <buffer> [[ <Cmd>call <SID>jumpToSection(1)<CR>
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58 vnoremap <silent> <buffer> [[ <Cmd>call <SID>jumpToSection(1)<CR>
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59 nnoremap <silent> <buffer> [] <Cmd>call <SID>jumpToSection(1)<CR>
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60 vnoremap <silent> <buffer> [] <Cmd>call <SID>jumpToSection(1)<CR>
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61 let b:undo_ftplugin .=
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62 \ " | silent! exe 'nunmap <buffer> ]]' | silent! exe 'vunmap <buffer> ]]'" .
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63 \ " | silent! exe 'nunmap <buffer> ][' | silent! exe 'vunmap <buffer> ]['" .
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64 \ " | silent! exe 'nunmap <buffer> ]]' | silent! exe 'vunmap <buffer> ]]'" .
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
65 \ " | silent! exe 'nunmap <buffer> []' | silent! exe 'vunmap <buffer> []'"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
66 endif
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
67
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
68 let &cpo = s:save_cpo
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
69 unlet s:save_cpo
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
70
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
71 " vim: set expandtab: