annotate runtime/ftplugin/c.vim @ 15113:ae25a1172514 v8.1.0567

patch 8.1.0567: error for NUL byte in ScreenLines goes unnoticed commit https://github.com/vim/vim/commit/4087bfd96d0d70791a1572ac4b40d5a655e2166b Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 7 13:26:39 2018 +0100 patch 8.1.0567: error for NUL byte in ScreenLines goes unnoticed Problem: Error for NUL byte in ScreenLines goes unnoticed. Solution: Add an internal error message.
author Bram Moolenaar <Bram@vim.org>
date Fri, 07 Dec 2018 13:30:08 +0100
parents 3b26420fc639
children 51bc26d4a393
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: C
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " Only do this when not done yet for this buffer
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 if exists("b:did_ftplugin")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " Don't load another plugin for this buffer
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 let b:did_ftplugin = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
233
fca8a9b65afa updated for version 7.0065
vimboss
parents: 22
diff changeset
14 " Using line continuation here.
348
7e819e81117e updated for version 7.0090
vimboss
parents: 233
diff changeset
15 let s:cpo_save = &cpo
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 set cpo-=C
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
502
52e76e2b5b65 updated for version 7.0140
vimboss
parents: 348
diff changeset
18 let b:undo_ftplugin = "setl fo< com< ofu< | if has('vms') | setl isk< | endif"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " Set 'formatoptions' to break comment lines but not other lines,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " and insert the comment leader when hitting <CR> or using "o".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 setlocal fo-=t fo+=croql
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
502
52e76e2b5b65 updated for version 7.0140
vimboss
parents: 348
diff changeset
24 " Set completion with CTRL-X CTRL-O to autoloaded function.
52e76e2b5b65 updated for version 7.0140
vimboss
parents: 348
diff changeset
25 if exists('&ofu')
52e76e2b5b65 updated for version 7.0140
vimboss
parents: 348
diff changeset
26 setlocal ofu=ccomplete#Complete
52e76e2b5b65 updated for version 7.0140
vimboss
parents: 348
diff changeset
27 endif
52e76e2b5b65 updated for version 7.0140
vimboss
parents: 348
diff changeset
28
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " Set 'comments' to format dashed lists in comments.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 " In VMS C keywords contain '$' characters.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 if has("vms")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 setlocal iskeyword+=$
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 502
diff changeset
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
82b5078be2dd updated for version 7.2a
vimboss
parents: 502
diff changeset
41
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 " Win32 can filter files in the browse dialog
3682
11d40fc82f11 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
43 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 if &ft == "cpp"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 let b:browsefilter = "C++ Source Files (*.cpp *.c++)\t*.cpp;*.c++\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 \ "C Header Files (*.h)\t*.h\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 \ "C Source Files (*.c)\t*.c\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 \ "All Files (*.*)\t*.*\n"
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
49 elseif &ft == "ch"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 let b:browsefilter = "Ch Source Files (*.ch *.chf)\t*.ch;*.chf\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 \ "C Header Files (*.h)\t*.h\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 \ "C Source Files (*.c)\t*.c\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 \ "All Files (*.*)\t*.*\n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 let b:browsefilter = "C Source Files (*.c)\t*.c\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 \ "C Header Files (*.h)\t*.h\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 \ "Ch Source Files (*.ch *.chf)\t*.ch;*.chf\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 \ "C++ Source Files (*.cpp *.c++)\t*.cpp;*.c++\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 \ "All Files (*.*)\t*.*\n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 endif
348
7e819e81117e updated for version 7.0090
vimboss
parents: 233
diff changeset
62
7e819e81117e updated for version 7.0090
vimboss
parents: 233
diff changeset
63 let &cpo = s:cpo_save
7e819e81117e updated for version 7.0090
vimboss
parents: 233
diff changeset
64 unlet s:cpo_save