Mercurial > vim
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 |
rev | line source |
---|---|
7 | 1 " Vim filetype plugin file |
2 " Language: php | |
28010 | 3 " |
4 " This runtime file is looking for a new maintainer. | |
5 " | |
6 " Former maintainer: Dan Sharp | |
2034 | 7 " Last Changed: 20 Jan 2009 |
7 | 8 |
9 if exists("b:did_ftplugin") | finish | endif | |
10 | |
11 " Make sure the continuation lines below do not cause problems in | |
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 | 15 |
16 " Define some defaults in case the included ftplugins don't set them. | |
17 let s:undo_ftplugin = "" | |
15 | 18 let s:browsefilter = "HTML Files (*.html, *.htm)\t*.html;*.htm\n" . |
7 | 19 \ "All Files (*.*)\t*.*\n" |
20 let s:match_words = "" | |
21 | |
22 runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim | |
23 let b:did_ftplugin = 1 | |
24 | |
25 " Override our defaults if these were set by an included ftplugin. | |
26 if exists("b:undo_ftplugin") | |
27 let s:undo_ftplugin = b:undo_ftplugin | |
28 endif | |
29 if exists("b:browsefilter") | |
30 let s:browsefilter = b:browsefilter | |
31 endif | |
32 if exists("b:match_words") | |
33 let s:match_words = b:match_words | |
34 endif | |
1125 | 35 if exists("b:match_skip") |
36 unlet b:match_skip | |
37 endif | |
7 | 38 |
39 " Change the :browse e filter to primarily show PHP-related files. | |
40 if has("gui_win32") | |
41 let b:browsefilter="PHP Files (*.php)\t*.php\n" . s:browsefilter | |
42 endif | |
43 | |
44 " ### | |
45 " Provided by Mikolaj Machowski <mikmach at wp dot pl> | |
46 setlocal include=\\\(require\\\|include\\\)\\\(_once\\\)\\\? | |
1622 | 47 " Disabled changing 'iskeyword', it breaks a command such as "*" |
48 " setlocal iskeyword+=$ | |
49 | |
7 | 50 if exists("loaded_matchit") |
1125 | 51 let b:match_words = '<?php:?>,\<switch\>:\<endswitch\>,' . |
7 | 52 \ '\<if\>:\<elseif\>:\<else\>:\<endif\>,' . |
53 \ '\<while\>:\<endwhile\>,' . | |
54 \ '\<do\>:\<while\>,' . | |
55 \ '\<for\>:\<endfor\>,' . | |
56 \ '\<foreach\>:\<endforeach\>,' . | |
1125 | 57 \ '(:),[:],{:},' . |
7 | 58 \ s:match_words |
59 endif | |
60 " ### | |
61 | |
1622 | 62 if exists('&omnifunc') |
63 setlocal omnifunc=phpcomplete#CompletePHP | |
714 | 64 endif |
65 | |
1622 | 66 " Section jumping: [[ and ]] provided by Antony Scriven <adscriven at gmail dot com> |
67 let s:function = '\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function' | |
68 let s:class = '\(abstract\s\+\|final\s\+\)*class' | |
69 let s:interface = 'interface' | |
70 let s:section = '\(.*\%#\)\@!\_^\s*\zs\('.s:function.'\|'.s:class.'\|'.s:interface.'\)' | |
71 exe 'nno <buffer> <silent> [[ ?' . escape(s:section, '|') . '?<CR>:nohls<CR>' | |
72 exe 'nno <buffer> <silent> ]] /' . escape(s:section, '|') . '/<CR>:nohls<CR>' | |
73 exe 'ono <buffer> <silent> [[ ?' . escape(s:section, '|') . '?<CR>:nohls<CR>' | |
74 exe 'ono <buffer> <silent> ]] /' . escape(s:section, '|') . '/<CR>:nohls<CR>' | |
714 | 75 |
28141 | 76 setlocal suffixesadd=.php |
7 | 77 setlocal commentstring=/*%s*/ |
78 | |
79 " Undo the stuff we changed. | |
28141 | 80 let b:undo_ftplugin = "setlocal suffixesadd< commentstring< include< omnifunc<" . |
7 | 81 \ " | unlet! b:browsefilter b:match_words | " . |
82 \ s:undo_ftplugin | |
83 | |
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 |