Mercurial > vim
annotate runtime/ftplugin/eruby.vim @ 34342:dd5023389a98 v9.1.0104
patch 9.1.0104: Linking fails with -lto because of PERL_CFLAGS
Commit: https://github.com/vim/vim/commit/2f9aef42af94f6d68f37f6e9b8cb878e88ed12bf
Author: Christian Brabandt <cb@256bit.org>
Date: Mon Feb 12 23:12:26 2024 +0100
patch 9.1.0104: Linking fails with -lto because of PERL_CFLAGS
Problem: Linking fails with -lto because of PERL_CFLAGS
(Zoltan Toth)
Solution: Filter out -flto argument from Perl CFLAGS.
fixes: #14012
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 12 Feb 2024 23:30:03 +0100 |
parents | 8ae680be2a51 |
children | 7c7432a53a6c |
rev | line source |
---|---|
529 | 1 " Vim filetype plugin |
831 | 2 " Language: eRuby |
2225 | 3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org> |
4869 | 4 " URL: https://github.com/vim-ruby/vim-ruby |
831 | 5 " Release Coordinator: Doug Kearns <dougkearns@gmail.com> |
33098
d3d82d3f6006
runtime(ruby): Update syntax, indent and ftplugin files
Christian Brabandt <cb@256bit.org>
parents:
25056
diff
changeset
|
6 " Last Change: 2022 May 15 |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33098
diff
changeset
|
7 " 2024 Jan 14 by Vim Project (browsefilter) |
529 | 8 |
9 " Only do this when not done yet for this buffer | |
1205 | 10 if exists("b:did_ftplugin") |
529 | 11 finish |
12 endif | |
13 | |
14 let s:save_cpo = &cpo | |
15 set cpo-=C | |
16 | |
17 " Define some defaults in case the included ftplugins don't set them. | |
18 let s:undo_ftplugin = "" | |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33098
diff
changeset
|
19 if has("win32") |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33098
diff
changeset
|
20 let s:browsefilter = "All Files (*.*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33098
diff
changeset
|
21 else |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33098
diff
changeset
|
22 let s:browsefilter = "All Files (*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33098
diff
changeset
|
23 endif |
529 | 24 let s:match_words = "" |
25 | |
1205 | 26 if !exists("g:eruby_default_subtype") |
27 let g:eruby_default_subtype = "html" | |
28 endif | |
29 | |
4869 | 30 if &filetype =~ '^eruby\.' |
31 let b:eruby_subtype = matchstr(&filetype,'^eruby\.\zs\w\+') | |
32 elseif !exists("b:eruby_subtype") | |
1205 | 33 let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") |
34 let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+') | |
35 if b:eruby_subtype == '' | |
15512 | 36 let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\|\.example\)\+$','',''),'\.\zs\w\+\%(\ze+\w\+\)\=$') |
1205 | 37 endif |
38 if b:eruby_subtype == 'rhtml' | |
39 let b:eruby_subtype = 'html' | |
40 elseif b:eruby_subtype == 'rb' | |
41 let b:eruby_subtype = 'ruby' | |
42 elseif b:eruby_subtype == 'yml' | |
43 let b:eruby_subtype = 'yaml' | |
44 elseif b:eruby_subtype == 'js' | |
45 let b:eruby_subtype = 'javascript' | |
46 elseif b:eruby_subtype == 'txt' | |
47 " Conventional; not a real file type | |
48 let b:eruby_subtype = 'text' | |
49 elseif b:eruby_subtype == '' | |
50 let b:eruby_subtype = g:eruby_default_subtype | |
51 endif | |
52 endif | |
53 | |
15512 | 54 if exists("b:eruby_subtype") && b:eruby_subtype != '' && b:eruby_subtype !=? 'eruby' |
1205 | 55 exe "runtime! ftplugin/".b:eruby_subtype.".vim ftplugin/".b:eruby_subtype."_*.vim ftplugin/".b:eruby_subtype."/*.vim" |
56 else | |
57 runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim | |
58 endif | |
59 unlet! b:did_ftplugin | |
529 | 60 |
61 " Override our defaults if these were set by an included ftplugin. | |
62 if exists("b:undo_ftplugin") | |
1205 | 63 let s:undo_ftplugin = b:undo_ftplugin |
64 unlet b:undo_ftplugin | |
529 | 65 endif |
66 if exists("b:browsefilter") | |
1205 | 67 let s:browsefilter = b:browsefilter |
68 unlet b:browsefilter | |
529 | 69 endif |
70 if exists("b:match_words") | |
1205 | 71 let s:match_words = b:match_words |
72 unlet b:match_words | |
529 | 73 endif |
74 | |
15512 | 75 let s:cfilemap = v:version >= 704 ? maparg('<Plug><cfile>', 'c', 0, 1) : {} |
76 if !get(s:cfilemap, 'buffer') || !s:cfilemap.expr || s:cfilemap.rhs =~# 'ErubyAtCursor()' | |
77 let s:cfilemap = {} | |
78 endif | |
79 if !has_key(s:cfilemap, 'rhs') | |
80 let s:cfilemap.rhs = "substitute(&l:inex =~# '\\<v:fname\\>' && len(expand('<cfile>')) ? eval(substitute(&l:inex, '\\<v:fname\\>', '\\=string(expand(\"<cfile>\"))', 'g')) : '', '^$', \"\\022\\006\",'')" | |
81 endif | |
82 let s:ctagmap = v:version >= 704 ? maparg('<Plug><ctag>', 'c', 0, 1) : {} | |
83 if !get(s:ctagmap, 'buffer') || !s:ctagmap.expr || s:ctagmap.rhs =~# 'ErubyAtCursor()' | |
84 let s:ctagmap = {} | |
85 endif | |
86 let s:include = &l:include | |
87 let s:path = &l:path | |
88 let s:suffixesadd = &l:suffixesadd | |
89 | |
529 | 90 runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim |
91 let b:did_ftplugin = 1 | |
92 | |
93 " Combine the new set of values with those previously included. | |
33098
d3d82d3f6006
runtime(ruby): Update syntax, indent and ftplugin files
Christian Brabandt <cb@256bit.org>
parents:
25056
diff
changeset
|
94 if !exists('b:undo_ftplugin') |
d3d82d3f6006
runtime(ruby): Update syntax, indent and ftplugin files
Christian Brabandt <cb@256bit.org>
parents:
25056
diff
changeset
|
95 " No-op |
d3d82d3f6006
runtime(ruby): Update syntax, indent and ftplugin files
Christian Brabandt <cb@256bit.org>
parents:
25056
diff
changeset
|
96 let b:undo_ftplugin = 'exe' |
d3d82d3f6006
runtime(ruby): Update syntax, indent and ftplugin files
Christian Brabandt <cb@256bit.org>
parents:
25056
diff
changeset
|
97 endif |
d3d82d3f6006
runtime(ruby): Update syntax, indent and ftplugin files
Christian Brabandt <cb@256bit.org>
parents:
25056
diff
changeset
|
98 if !empty(s:undo_ftplugin) |
d3d82d3f6006
runtime(ruby): Update syntax, indent and ftplugin files
Christian Brabandt <cb@256bit.org>
parents:
25056
diff
changeset
|
99 let b:undo_ftplugin .= '|' . s:undo_ftplugin |
529 | 100 endif |
101 if exists ("b:browsefilter") | |
1205 | 102 let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter |
529 | 103 endif |
104 if exists("b:match_words") | |
1205 | 105 let s:match_words = b:match_words . ',' . s:match_words |
529 | 106 endif |
107 | |
15512 | 108 if len(s:include) |
109 let &l:include = s:include | |
110 endif | |
111 let &l:path = s:path . (s:path =~# ',$\|^$' ? '' : ',') . &l:path | |
112 let &l:suffixesadd = s:suffixesadd . (s:suffixesadd =~# ',$\|^$' ? '' : ',') . &l:suffixesadd | |
113 exe 'cmap <buffer><script><expr> <Plug><cfile> ErubyAtCursor() ? ' . maparg('<Plug><cfile>', 'c') . ' : ' . s:cfilemap.rhs | |
114 exe 'cmap <buffer><script><expr> <Plug><ctag> ErubyAtCursor() ? ' . maparg('<Plug><ctag>', 'c') . ' : ' . get(s:ctagmap, 'rhs', '"\022\027"') | |
115 unlet s:cfilemap s:ctagmap s:include s:path s:suffixesadd | |
116 | |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33098
diff
changeset
|
117 " Change the browse dialog on Win32 and GTK to show mainly eRuby-related files |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33098
diff
changeset
|
118 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") |
1205 | 119 let b:browsefilter="eRuby Files (*.erb, *.rhtml)\t*.erb;*.rhtml\n" . s:browsefilter |
529 | 120 endif |
121 | |
122 " Load the combined list of match_words for matchit.vim | |
123 if exists("loaded_matchit") | |
1205 | 124 let b:match_words = s:match_words |
529 | 125 endif |
126 | |
127 " TODO: comments= | |
128 setlocal commentstring=<%#%s%> | |
129 | |
25056 | 130 let b:undo_ftplugin = "setl cms< " . |
33098
d3d82d3f6006
runtime(ruby): Update syntax, indent and ftplugin files
Christian Brabandt <cb@256bit.org>
parents:
25056
diff
changeset
|
131 \ " | unlet! b:browsefilter b:match_words | " . b:undo_ftplugin |
529 | 132 |
133 let &cpo = s:save_cpo | |
3410
94601b379f38
Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents:
2225
diff
changeset
|
134 unlet s:save_cpo |
529 | 135 |
15512 | 136 function! ErubyAtCursor() abort |
137 let groups = map(['erubyBlock', 'erubyComment', 'erubyExpression', 'erubyOneLiner'], 'hlID(v:val)') | |
138 return !empty(filter(synstack(line('.'), col('.')), 'index(groups, v:val) >= 0')) | |
139 endfunction | |
140 | |
1620 | 141 " vim: nowrap sw=2 sts=2 ts=8: |