annotate runtime/ftplugin/eruby.vim @ 3586:583e46e4a56c v7.3.553

updated for version 7.3.553 Problem: With double-width characters and 'listchars' containing "precedes" the text is displayed one cell off. Solution: Check for double-width character being overwritten by the "precedes" character. (Yasuhiro Matsumoto)
author Bram Moolenaar <bram@vim.org>
date Wed, 13 Jun 2012 18:06:36 +0200
parents 94601b379f38
children a5352e73dc00
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
529
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
1 " Vim filetype plugin
831
f24a95dae8ee updated for version 7.0d05
vimboss
parents: 557
diff changeset
2 " Language: eRuby
2225
dd5c1983e355 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
3410
94601b379f38 Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents: 2225
diff changeset
4 " Last Change: 2012 Mar 11
831
f24a95dae8ee updated for version 7.0d05
vimboss
parents: 557
diff changeset
5 " URL: http://vim-ruby.rubyforge.org
f24a95dae8ee updated for version 7.0d05
vimboss
parents: 557
diff changeset
6 " Anon CVS: See above site
f24a95dae8ee updated for version 7.0d05
vimboss
parents: 557
diff changeset
7 " Release Coordinator: Doug Kearns <dougkearns@gmail.com>
529
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
8
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
9 " Only do this when not done yet for this buffer
1205
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
10 if exists("b:did_ftplugin")
529
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
11 finish
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
12 endif
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
13
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
14 let s:save_cpo = &cpo
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
15 set cpo-=C
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
16
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
17 " Define some defaults in case the included ftplugins don't set them.
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
18 let s:undo_ftplugin = ""
1205
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
19 let s:browsefilter = "All Files (*.*)\t*.*\n"
529
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
20 let s:match_words = ""
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
21
1205
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
22 if !exists("g:eruby_default_subtype")
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
23 let g:eruby_default_subtype = "html"
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
24 endif
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
25
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
26 if !exists("b:eruby_subtype")
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
27 let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
28 let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+')
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
29 if b:eruby_subtype == ''
2225
dd5c1983e355 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
30 let b:eruby_subtype = matchstr(&filetype,'^eruby\.\zs\w\+')
dd5c1983e355 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
31 endif
dd5c1983e355 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
32 if b:eruby_subtype == ''
dd5c1983e355 Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
33 let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+$')
1205
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
34 endif
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
35 if b:eruby_subtype == 'rhtml'
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
36 let b:eruby_subtype = 'html'
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
37 elseif b:eruby_subtype == 'rb'
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
38 let b:eruby_subtype = 'ruby'
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
39 elseif b:eruby_subtype == 'yml'
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
40 let b:eruby_subtype = 'yaml'
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
41 elseif b:eruby_subtype == 'js'
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
42 let b:eruby_subtype = 'javascript'
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
43 elseif b:eruby_subtype == 'txt'
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
44 " Conventional; not a real file type
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
45 let b:eruby_subtype = 'text'
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
46 elseif b:eruby_subtype == ''
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
47 let b:eruby_subtype = g:eruby_default_subtype
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
48 endif
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
49 endif
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
50
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
51 if exists("b:eruby_subtype") && b:eruby_subtype != ''
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
52 exe "runtime! ftplugin/".b:eruby_subtype.".vim ftplugin/".b:eruby_subtype."_*.vim ftplugin/".b:eruby_subtype."/*.vim"
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
53 else
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
54 runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
55 endif
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
56 unlet! b:did_ftplugin
529
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
57
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
58 " Override our defaults if these were set by an included ftplugin.
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
59 if exists("b:undo_ftplugin")
1205
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
60 let s:undo_ftplugin = b:undo_ftplugin
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
61 unlet b:undo_ftplugin
529
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
62 endif
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
63 if exists("b:browsefilter")
1205
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
64 let s:browsefilter = b:browsefilter
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
65 unlet b:browsefilter
529
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
66 endif
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
67 if exists("b:match_words")
1205
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
68 let s:match_words = b:match_words
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
69 unlet b:match_words
529
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
70 endif
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
71
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
72 runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
73 let b:did_ftplugin = 1
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
74
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
75 " Combine the new set of values with those previously included.
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
76 if exists("b:undo_ftplugin")
1205
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
77 let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin
529
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
78 endif
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
79 if exists ("b:browsefilter")
1205
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
80 let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter
529
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
81 endif
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
82 if exists("b:match_words")
1205
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
83 let s:match_words = b:match_words . ',' . s:match_words
529
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
84 endif
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
85
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
86 " Change the browse dialog on Win32 to show mainly eRuby-related files
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
87 if has("gui_win32")
1205
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
88 let b:browsefilter="eRuby Files (*.erb, *.rhtml)\t*.erb;*.rhtml\n" . s:browsefilter
529
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
89 endif
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
90
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
91 " Load the combined list of match_words for matchit.vim
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
92 if exists("loaded_matchit")
1205
b05620bdba29 updated for version 7.1b
vimboss
parents: 831
diff changeset
93 let b:match_words = s:match_words
529
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
94 endif
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
95
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
96 " TODO: comments=
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
97 setlocal commentstring=<%#%s%>
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
98
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
99 let b:undo_ftplugin = "setl cms< "
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
100 \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
101
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
102 let &cpo = s:save_cpo
3410
94601b379f38 Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents: 2225
diff changeset
103 unlet s:save_cpo
529
0d6092bb72e6 updated for version 7.0148
vimboss
parents:
diff changeset
104
1620
73fe8baea242 updated for version 7.2a
vimboss
parents: 1205
diff changeset
105 " vim: nowrap sw=2 sts=2 ts=8: