equal
deleted
inserted
replaced
56 " This operates under the assumption that you've used chdir() to put vim into |
56 " This operates under the assumption that you've used chdir() to put vim into |
57 " the top level directory of your project. |
57 " the top level directory of your project. |
58 " |
58 " |
59 function! <SID>SpecSwitcher() |
59 function! <SID>SpecSwitcher() |
60 |
60 |
61 " If we aren't in a ruby file (specs are ruby-mode too) then we probably |
61 " If we aren't in a ruby or rspec file then we probably don't care |
62 " don't care too much about this function. |
62 " too much about this function. |
63 " |
63 " |
64 if &ft != 'ruby' |
64 if &ft != 'ruby' && &ft != 'rspec' |
65 call s:err( "Not currently in ruby-mode." ) |
65 call s:err( "Not currently in ruby or rspec mode." ) |
66 return |
66 return |
67 endif |
67 endif |
68 |
68 |
69 " Ensure that we can always search recursively for files to open. |
69 " Ensure that we can always search recursively for files to open. |
70 " |
70 " |
120 " Double quote to single |
120 " Double quote to single |
121 " |
121 " |
122 execute ":normal viWc'" . l:word . "'" |
122 execute ":normal viWc'" . l:word . "'" |
123 |
123 |
124 elseif l:type == "'" |
124 elseif l:type == "'" |
125 if &ft == "ruby" |
125 if &ft == 'ruby' || &ft == 'rspec' |
126 " Single quote to symbol |
126 " Single quote to symbol |
127 " |
127 " |
128 execute ':normal viWc:' . l:word |
128 execute ':normal viWc:' . l:word |
129 else |
129 else |
130 " Single quote to double |
130 " Single quote to double |