annotate runtime/ftplugin/php.vim @ 29603:8f01d250793a v9.0.0142

patch 9.0.0142: crash when adding and removing virtual text Commit: https://github.com/vim/vim/commit/2f83cc4cfa56750c91eb6daa8fde319bca032d18 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Aug 5 11:45:17 2022 +0100 patch 9.0.0142: crash when adding and removing virtual text Problem: Crash when adding and removing virtual text. (Ben Jackson) Solution: Check that the text of the text property still exists.
author Bram Moolenaar <Bram@vim.org>
date Fri, 05 Aug 2022 13:00:03 +0200
parents dce918af0c00
children 2198955f9e27
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: php
28010
c968191a8557 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 3496
diff changeset
3 "
c968191a8557 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 3496
diff changeset
4 " This runtime file is looking for a new maintainer.
c968191a8557 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 3496
diff changeset
5 "
c968191a8557 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 3496
diff changeset
6 " Former maintainer: Dan Sharp
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
7 " Last Changed: 20 Jan 2009
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 if exists("b:did_ftplugin") | finish | endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " Make sure the continuation lines below do not cause problems in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " compatibility mode.
3496
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
13 let s:keepcpo= &cpo
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
14 set cpo&vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 " Define some defaults in case the included ftplugins don't set them.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 let s:undo_ftplugin = ""
15
631143ac4a01 updated for version 7.0007
vimboss
parents: 7
diff changeset
18 let s:browsefilter = "HTML Files (*.html, *.htm)\t*.html;*.htm\n" .
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 \ "All Files (*.*)\t*.*\n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 let s:match_words = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 let b:did_ftplugin = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 " Override our defaults if these were set by an included ftplugin.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 if exists("b:undo_ftplugin")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 let s:undo_ftplugin = b:undo_ftplugin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 if exists("b:browsefilter")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 let s:browsefilter = b:browsefilter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 if exists("b:match_words")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 let s:match_words = b:match_words
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 endif
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 714
diff changeset
35 if exists("b:match_skip")
96cd8222a819 updated for version 7.1a
vimboss
parents: 714
diff changeset
36 unlet b:match_skip
96cd8222a819 updated for version 7.1a
vimboss
parents: 714
diff changeset
37 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " Change the :browse e filter to primarily show PHP-related files.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 if has("gui_win32")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 let b:browsefilter="PHP Files (*.php)\t*.php\n" . s:browsefilter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 " ###
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 " Provided by Mikolaj Machowski <mikmach at wp dot pl>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 setlocal include=\\\(require\\\|include\\\)\\\(_once\\\)\\\?
1622
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
47 " Disabled changing 'iskeyword', it breaks a command such as "*"
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
48 " setlocal iskeyword+=$
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
49
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 if exists("loaded_matchit")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 714
diff changeset
51 let b:match_words = '<?php:?>,\<switch\>:\<endswitch\>,' .
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 \ '\<if\>:\<elseif\>:\<else\>:\<endif\>,' .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 \ '\<while\>:\<endwhile\>,' .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 \ '\<do\>:\<while\>,' .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 \ '\<for\>:\<endfor\>,' .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 \ '\<foreach\>:\<endforeach\>,' .
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 714
diff changeset
57 \ '(:),[:],{:},' .
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 \ s:match_words
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 " ###
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61
1622
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
62 if exists('&omnifunc')
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
63 setlocal omnifunc=phpcomplete#CompletePHP
714
0f9f4761ad9c updated for version 7.0216
vimboss
parents: 507
diff changeset
64 endif
0f9f4761ad9c updated for version 7.0216
vimboss
parents: 507
diff changeset
65
1622
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
66 " Section jumping: [[ and ]] provided by Antony Scriven <adscriven at gmail dot com>
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
67 let s:function = '\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function'
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
68 let s:class = '\(abstract\s\+\|final\s\+\)*class'
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
69 let s:interface = 'interface'
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
70 let s:section = '\(.*\%#\)\@!\_^\s*\zs\('.s:function.'\|'.s:class.'\|'.s:interface.'\)'
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
71 exe 'nno <buffer> <silent> [[ ?' . escape(s:section, '|') . '?<CR>:nohls<CR>'
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
72 exe 'nno <buffer> <silent> ]] /' . escape(s:section, '|') . '/<CR>:nohls<CR>'
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
73 exe 'ono <buffer> <silent> [[ ?' . escape(s:section, '|') . '?<CR>:nohls<CR>'
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
74 exe 'ono <buffer> <silent> ]] /' . escape(s:section, '|') . '/<CR>:nohls<CR>'
714
0f9f4761ad9c updated for version 7.0216
vimboss
parents: 507
diff changeset
75
28141
dce918af0c00 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28010
diff changeset
76 setlocal suffixesadd=.php
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 setlocal commentstring=/*%s*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 " Undo the stuff we changed.
28141
dce918af0c00 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28010
diff changeset
80 let b:undo_ftplugin = "setlocal suffixesadd< commentstring< include< omnifunc<" .
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 \ " | unlet! b:browsefilter b:match_words | " .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 \ s:undo_ftplugin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 " Restore the saved compatibility options.
3496
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
85 let &cpo = s:keepcpo
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
86 unlet s:keepcpo