Mercurial > vim
annotate runtime/ftplugin/c.vim @ 15914:c94b46f98b1a v8.1.0963
patch 8.1.0963: illegal memory access when using 'incsearch'
commit https://github.com/vim/vim/commit/4a7d2d3b407ed695450bb7f43166e2f2722a6836
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Feb 21 16:25:50 2019 +0100
patch 8.1.0963: illegal memory access when using 'incsearch'
Problem: Illegal memory access when using 'incsearch'.
Solution: Reset highlight_match when changing text. (closes https://github.com/vim/vim/issues/4022)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 21 Feb 2019 16:30:15 +0100 |
parents | 3b26420fc639 |
children | 51bc26d4a393 |
rev | line source |
---|---|
7 | 1 " Vim filetype plugin file |
2 " Language: C | |
3 " Maintainer: Bram Moolenaar <Bram@vim.org> | |
12756
3b26420fc639
Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents:
9286
diff
changeset
|
4 " Last Change: 2017 Sep 28 |
7 | 5 |
6 " Only do this when not done yet for this buffer | |
7 if exists("b:did_ftplugin") | |
8 finish | |
9 endif | |
10 | |
11 " Don't load another plugin for this buffer | |
12 let b:did_ftplugin = 1 | |
13 | |
233 | 14 " Using line continuation here. |
348 | 15 let s:cpo_save = &cpo |
7 | 16 set cpo-=C |
17 | |
502 | 18 let b:undo_ftplugin = "setl fo< com< ofu< | if has('vms') | setl isk< | endif" |
7 | 19 |
20 " Set 'formatoptions' to break comment lines but not other lines, | |
21 " and insert the comment leader when hitting <CR> or using "o". | |
22 setlocal fo-=t fo+=croql | |
23 | |
502 | 24 " Set completion with CTRL-X CTRL-O to autoloaded function. |
25 if exists('&ofu') | |
26 setlocal ofu=ccomplete#Complete | |
27 endif | |
28 | |
7 | 29 " Set 'comments' to format dashed lists in comments. |
30 setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// | |
31 | |
32 " In VMS C keywords contain '$' characters. | |
33 if has("vms") | |
34 setlocal iskeyword+=$ | |
35 endif | |
36 | |
1621 | 37 " When the matchit plugin is loaded, this makes the % command skip parens and |
12756
3b26420fc639
Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents:
9286
diff
changeset
|
38 " braces in comments properly. |
3b26420fc639
Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents:
9286
diff
changeset
|
39 let b:match_words = '^\s*#\s*if\(\|def\|ndef\)\>:^\s*#\s*elif\>:^\s*#\s*else\>:^\s*#\s*endif\>' |
9286
64035abb986b
commit https://github.com/vim/vim/commit/c95a302a4c42ec8230473cd4a5e0064d0a143aa8
Christian Brabandt <cb@256bit.org>
parents:
3682
diff
changeset
|
40 let b:match_skip = 's:comment\|string\|character\|special' |
1621 | 41 |
7 | 42 " Win32 can filter files in the browse dialog |
3682 | 43 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") |
7 | 44 if &ft == "cpp" |
45 let b:browsefilter = "C++ Source Files (*.cpp *.c++)\t*.cpp;*.c++\n" . | |
46 \ "C Header Files (*.h)\t*.h\n" . | |
47 \ "C Source Files (*.c)\t*.c\n" . | |
48 \ "All Files (*.*)\t*.*\n" | |
22 | 49 elseif &ft == "ch" |
7 | 50 let b:browsefilter = "Ch Source Files (*.ch *.chf)\t*.ch;*.chf\n" . |
51 \ "C Header Files (*.h)\t*.h\n" . | |
52 \ "C Source Files (*.c)\t*.c\n" . | |
53 \ "All Files (*.*)\t*.*\n" | |
54 else | |
55 let b:browsefilter = "C Source Files (*.c)\t*.c\n" . | |
56 \ "C Header Files (*.h)\t*.h\n" . | |
57 \ "Ch Source Files (*.ch *.chf)\t*.ch;*.chf\n" . | |
58 \ "C++ Source Files (*.cpp *.c++)\t*.cpp;*.c++\n" . | |
59 \ "All Files (*.*)\t*.*\n" | |
60 endif | |
61 endif | |
348 | 62 |
63 let &cpo = s:cpo_save | |
64 unlet s:cpo_save |