annotate runtime/ftplugin/perl.vim @ 34546:33cb93a8d573 v9.1.0174

patch 9.1.0174: 'cursorline' and 'wincolor' hl missing with conceal and wrap Commit: https://github.com/vim/vim/commit/21b0a3df8c4abb884489dfcc0c92b1bbe058f291 Author: zeertzjq <zeertzjq@outlook.com> Date: Wed Mar 13 20:06:34 2024 +0100 patch 9.1.0174: 'cursorline' and 'wincolor' hl missing with conceal and wrap Problem: 'cursorline' and 'wincolor' highlight missing with concealed and wrapped lines. Solution: Apply 'cursorline' and 'wincolor' highlight to boguscols. (zeertzjq) Since 'cursorline' and 'wincolor' highlight apply after the end of the line, it is more consistent to have them also apply to boguscols. Assigning MAXCOL to values in ScreenCols[] make mouse click behave the same with 'cursorline' and 'nocursorline', but such behavior may be incorrect, as it puts the cursor on the next screen line. That may be fixed in a future PR. closes: #14192 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Wed, 13 Mar 2024 20:15:03 +0100
parents 8ae680be2a51
children 7c7432a53a6c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim filetype plugin file
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
2 " Language: Perl
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
3 " Maintainer: vim-perl <vim-perl@googlegroups.com>
20115
bd021eb62e73 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
4 " Homepage: https://github.com/vim-perl/vim-perl
bd021eb62e73 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
5 " Bugs/requests: https://github.com/vim-perl/vim-perl/issues
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
6 " License: Vim License (see :help license)
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
7 " Last Change: 2021 Nov 10
33213
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 33203
diff changeset
8 " 2023 Sep 07 by Vim Project (safety check: don't execute perl
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 33203
diff changeset
9 " from current directory)
34134
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33716
diff changeset
10 " 2024 Jan 14 by Vim Project (browsefilter)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 if exists("b:did_ftplugin") | finish | endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 let b:did_ftplugin = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " Make sure the continuation lines below do not cause problems in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 " compatibility mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 let s:save_cpo = &cpo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 set cpo-=C
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
20 setlocal formatoptions-=t
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
21 setlocal formatoptions+=crqol
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1621
diff changeset
22 setlocal keywordprg=perldoc\ -f
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 setlocal comments=:#
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 setlocal commentstring=#%s
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 " Provided by Ned Konz <ned at bike-nomad dot com>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 "---------------------------------------------
603
e4c00ec07598 updated for version 7.0171
vimboss
parents: 36
diff changeset
29 setlocal include=\\<\\(use\\\|require\\)\\>
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
30 " '+' is removed to support plugins in Catalyst or DBIx::Class
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
31 " where the leading plus indicates a fully-qualified module name.
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
32 setlocal includeexpr=substitute(substitute(substitute(substitute(v:fname,'+','',''),'::','/','g'),'->\*','',''),'$','.pm','')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 setlocal define=[^A-Za-z_]
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
34 setlocal iskeyword+=:
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 " The following line changes a global variable but is necessary to make
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
37 " gf and similar commands work. Thanks to Andrew Pimlott for pointing
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
38 " out the problem.
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
39 let s:old_isfname = &isfname
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 set isfname+=:
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
41 let s:new_isfname = &isfname
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
42
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
43 augroup perl_global_options
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
44 au!
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
45 exe "au BufEnter * if &filetype == 'perl' | let &isfname = '" . s:new_isfname . "' | endif"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
46 exe "au BufLeave * if &filetype == 'perl' | let &isfname = '" . s:old_isfname . "' | endif"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
47 augroup END
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
48
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
49 " Undo the stuff we changed.
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
50 let b:undo_ftplugin = "setlocal fo< kp< com< cms< inc< inex< def< isk<" .
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
51 \ " | let &isfname = '" . s:old_isfname . "'"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
52
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
53 if get(g:, 'perl_fold', 0)
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
54 setlocal foldmethod=syntax
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
55 let b:undo_ftplugin .= " | setlocal fdm<"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
56 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 " Set this once, globally.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 if !exists("perlpath")
33203
c3c347a71e05 runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents: 33196
diff changeset
60 " safety check: don't execute perl binary by default
33716
bd3ee5abdd7a runtime(dist): centralize safe executable check and add vim library (#13413)
Christian Brabandt <cb@256bit.org>
parents: 33213
diff changeset
61 if dist#vim#IsSafeExecutable('perl', 'perl')
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 603
diff changeset
62 try
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 if &shellxquote != '"'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 let perlpath = system('perl -e "print join(q/,/,@INC)"')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 let perlpath = system("perl -e 'print join(q/,/,@INC)'")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 let perlpath = substitute(perlpath,',.$',',,','')
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 603
diff changeset
69 catch /E145:/
82b5078be2dd updated for version 7.2a
vimboss
parents: 603
diff changeset
70 let perlpath = ".,,"
82b5078be2dd updated for version 7.2a
vimboss
parents: 603
diff changeset
71 endtry
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 " If we can't call perl to get its path, just default to using the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 " current directory and the directory of the current file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 let perlpath = ".,,"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
79 " Append perlpath to the existing path value, if it is set. Since we don't
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
80 " use += to do it because of the commas in perlpath, we have to handle the
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
81 " global / local settings, too.
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
82 if &l:path == ""
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
83 if &g:path == ""
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
84 let &l:path=perlpath
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
85 else
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
86 let &l:path=&g:path.",".perlpath
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
87 endif
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
88 else
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
89 let &l:path=&l:path.",".perlpath
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
90 endif
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
91
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
92 let b:undo_ftplugin .= " | setlocal pa<"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 "---------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
95 " Change the browse dialog to show mainly Perl-related files
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
96 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
97 let b:browsefilter = "Perl Source Files (*.pl)\t*.pl\n" .
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
98 \ "Perl Modules (*.pm)\t*.pm\n" .
34134
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33716
diff changeset
99 \ "Perl Documentation Files (*.pod)\t*.pod\n"
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33716
diff changeset
100 if has("win32")
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33716
diff changeset
101 let b:browsefilter .= "All Files (*.*)\t*\n"
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33716
diff changeset
102 else
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33716
diff changeset
103 let b:browsefilter .= "All Files (*)\t*\n"
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 33716
diff changeset
104 endif
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
105 let b:undo_ftplugin .= " | unlet! b:browsefilter"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
106 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
108 " Proper matching for matchit plugin
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
109 if exists("loaded_matchit") && !exists("b:match_words")
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
110 let b:match_skip = 's:comment\|string\|perlQQ\|perlShellCommand\|perlHereDoc\|perlSubstitution\|perlTranslation\|perlMatch\|perlFormatField'
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
111 let b:match_words = '\<if\>:\<elsif\>:\<else\>'
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
112 let b:undo_ftplugin .= " | unlet! b:match_words b:match_skip"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
113 endif
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
114
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 " Restore the saved compatibility options.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 let &cpo = s:save_cpo
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
117 unlet s:save_cpo s:old_isfname s:new_isfname