annotate runtime/ftplugin/pod.vim @ 34596:5a8340e044f4 v9.1.0190

patch 9.1.0190: complete_info() returns wrong order of items Commit: https://github.com/vim/vim/commit/8950bf7f8b85c1287d4e696965d88091fcc60594 Author: Girish Palya <girishji@gmail.com> Date: Wed Mar 20 20:07:29 2024 +0100 patch 9.1.0190: complete_info() returns wrong order of items Problem: complete_info() returns wrong order of items (after v9.0.2018) Solution: Revert Patch v9.0.2018 (Girish Palya) bug fix: complete_info() gives wrong results 1) complete_info() reverses list of items during <c-p> 2) 'selected' item index is wrong during <c-p> 3) number of items returnd can be wrong Solution: - Decouple 'cp_number' from 'selected' index since they need not be correlated - Do not iterate the list backwards - Add targeted tests Regression introduced by https://github.com/vim/vim/commit/69fb5afb3bc9da24c2fb0eafb0027ba9c6502fc2 Following are unnecessary commits to patch problems from above: https://github.com/vim/vim/commit/fef66301665027f1801a18d796f74584666f41ef https://github.com/vim/vim/commit/daef8c74375141974d61b85199b383017644978c All the tests from above commits are retained though. fixes: #14204 closes: #14241 Signed-off-by: Girish Palya <girishji@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Wed, 20 Mar 2024 20:15:03 +0100
parents 8ae680be2a51
children
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)
33213
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 29150
diff changeset
8 " Last Change: 2023 Jul 05
34134
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33213
diff changeset
9 " Last Change: 2021 Oct 19
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33213
diff changeset
10 " 2024 Jan 14 by Vim Project (browsefilter)
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 if exists("b:did_ftplugin")
33213
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 29150
diff changeset
13 finish
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 endif
33213
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 29150
diff changeset
15 let b:did_ftplugin = 1
29150
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 let s:save_cpo = &cpo
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 set cpo-=C
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 setlocal comments=fb:=for\ comment
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 setlocal commentstring==for\ comment\ %s
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 let b:undo_ftplugin = "setl com< cms<"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 if exists("loaded_matchit") && !exists("b:match_words")
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 let b:match_words =
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 \ '^=pod\>:^=cut\>,' .
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 \ '^=begin\s\+\(\S\+\):^=end\s\+\1,' .
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 \ '^=over\>:^=item\>:^=back\>,' .
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 \ '[IBCLEFSXZ]<<\%(\s\+\|$\)\@=:\%(\s\+\|^\)\@<=>>,' .
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 \ '[IBCLEFSXZ]<:>'
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 let b:undo_ftplugin .= " | unlet! b:match_words"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 endif
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 let b:browsefilter = "POD Source Files (*.pod)\t*.pod\n" .
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 \ "Perl Source Files (*.pl)\t*.pl\n" .
34134
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33213
diff changeset
38 \ "Perl Modules (*.pm)\t*.pm\n"
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33213
diff changeset
39 if has("win32")
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33213
diff changeset
40 let b:browsefilter .= "All Files (*.*)\t*\n"
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33213
diff changeset
41 else
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33213
diff changeset
42 let b:browsefilter .= "All Files (*)\t*\n"
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33213
diff changeset
43 endif
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 let b:undo_ftplugin .= " | unlet! b:browsefilter"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 endif
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46
33213
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 29150
diff changeset
47 function s:jumpToSection(direction)
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 29150
diff changeset
48 let flags = a:direction == "backward" ? "bsWz" : "sWz"
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 29150
diff changeset
49 if has("syntax_items")
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 let skip = "synIDattr(synID(line('.'), col('.'), 1), 'name') !~# '\\<podCommand\\>'"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51 else
33213
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 29150
diff changeset
52 let skip = ""
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 endif
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54 for i in range(v:count1)
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 call search('^=\a', flags, 0, 0, skip)
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 endfor
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 endfunction
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59 if !exists("no_plugin_maps") && !exists("no_pod_maps")
33213
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 29150
diff changeset
60 for s:mode in ["n", "o", "x"]
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 29150
diff changeset
61 for s:lhs in ["]]", "]["]
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 29150
diff changeset
62 execute s:mode . "noremap <silent> <buffer> " . s:lhs . " <Cmd>call <SID>jumpToSection('forward')<CR>"
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 29150
diff changeset
63 let b:undo_ftplugin .= " | silent! execute '" . s:mode . "unmap <buffer> " . s:lhs . "'"
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 29150
diff changeset
64 endfor
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 29150
diff changeset
65 for s:lhs in ["[[", "[]"]
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 29150
diff changeset
66 execute s:mode . "noremap <silent> <buffer> " . s:lhs . " <Cmd>call <SID>jumpToSection('backward')<CR>"
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 29150
diff changeset
67 let b:undo_ftplugin .= " | silent! execute '" . s:mode . "unmap <buffer> " . s:lhs . "'"
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 29150
diff changeset
68 endfor
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 29150
diff changeset
69 endfor
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 29150
diff changeset
70 unlet s:mode s:lhs
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
71 endif
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
72
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
73 let &cpo = s:save_cpo
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
74 unlet s:save_cpo
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
75
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
76 " vim: set expandtab: