Mercurial > vim
annotate runtime/ftplugin/c.vim @ 31289:4f1e70a709bb v9.0.0978
patch 9.0.0978: build errors without the +channel feature
Commit: https://github.com/vim/vim/commit/3b8c7083b265c35861a7f96b01c079471ff45152
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Nov 30 20:20:56 2022 +0000
patch 9.0.0978: build errors without the +channel feature
Problem: Build errors without the +channel feature. (John Marriott)
Solution: Adjust #ifdefs.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 30 Nov 2022 21:30:03 +0100 |
parents | 6dd88e45d47d |
children | 4027cefc2aab |
rev | line source |
---|---|
7 | 1 " Vim filetype plugin file |
2 " Language: C | |
3 " Maintainer: Bram Moolenaar <Bram@vim.org> | |
28379 | 4 " Last Change: 2022 Apr 08 |
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 | |
19303 | 18 let b:undo_ftplugin = "setl fo< com< ofu< cms< def< inc< | 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 | |
19303 | 24 " These options have the right value as default, but the user may have |
25 " overruled that. | |
26 setlocal commentstring& define& include& | |
27 | |
502 | 28 " Set completion with CTRL-X CTRL-O to autoloaded function. |
29 if exists('&ofu') | |
30 setlocal ofu=ccomplete#Complete | |
31 endif | |
32 | |
7 | 33 " Set 'comments' to format dashed lists in comments. |
28379 | 34 " Also include ///, used for Doxygen. |
35 setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,:// | |
7 | 36 |
37 " In VMS C keywords contain '$' characters. | |
38 if has("vms") | |
39 setlocal iskeyword+=$ | |
40 endif | |
41 | |
1621 | 42 " 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
|
43 " braces in comments properly. |
25836 | 44 if !exists("b:match_words") |
45 let b:match_words = '^\s*#\s*if\(\|def\|ndef\)\>:^\s*#\s*elif\>:^\s*#\s*else\>:^\s*#\s*endif\>' | |
46 let b:match_skip = 's:comment\|string\|character\|special' | |
47 let b:undo_ftplugin ..= " | unlet! b:match_skip b:match_words" | |
48 endif | |
1621 | 49 |
7 | 50 " Win32 can filter files in the browse dialog |
3682 | 51 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") |
7 | 52 if &ft == "cpp" |
53 let b:browsefilter = "C++ Source Files (*.cpp *.c++)\t*.cpp;*.c++\n" . | |
54 \ "C Header Files (*.h)\t*.h\n" . | |
55 \ "C Source Files (*.c)\t*.c\n" . | |
56 \ "All Files (*.*)\t*.*\n" | |
22 | 57 elseif &ft == "ch" |
7 | 58 let b:browsefilter = "Ch Source Files (*.ch *.chf)\t*.ch;*.chf\n" . |
59 \ "C Header Files (*.h)\t*.h\n" . | |
60 \ "C Source Files (*.c)\t*.c\n" . | |
61 \ "All Files (*.*)\t*.*\n" | |
62 else | |
63 let b:browsefilter = "C Source Files (*.c)\t*.c\n" . | |
64 \ "C Header Files (*.h)\t*.h\n" . | |
65 \ "Ch Source Files (*.ch *.chf)\t*.ch;*.chf\n" . | |
66 \ "C++ Source Files (*.cpp *.c++)\t*.cpp;*.c++\n" . | |
67 \ "All Files (*.*)\t*.*\n" | |
68 endif | |
25836 | 69 let b:undo_ftplugin ..= " | unlet! b:browsefilter" |
7 | 70 endif |
348 | 71 |
72 let &cpo = s:cpo_save | |
73 unlet s:cpo_save |