Skip to content

Commit eda65cc

Browse files
author
Mike Foley
committed
Prioritize projections over defaults
If a projection overrides a property in one of the default commands, we should use that before the defaults. Commit b56cad5 broke this behavior.
1 parent 3129808 commit eda65cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

autoload/rails.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2489,7 +2489,7 @@ function! s:app_commands() dict abort
24892489
\ '{"pattern": v:val[1], "template": v:val[2]}')
24902490

24912491
let all = self.projections()
2492-
for pattern in reverse(sort(keys(all), function('rails#lencmp')))
2492+
for pattern in sort(keys(all), function('rails#lencmp'))
24932493
let projection = all[pattern]
24942494
for name in s:split(get(projection, 'command', get(projection, 'type', get(projection, 'name', ''))))
24952495
let command = {
@@ -2498,7 +2498,7 @@ function! s:app_commands() dict abort
24982498
if !has_key(commands, name)
24992499
let commands[name] = []
25002500
endif
2501-
call extend(commands[name], [command])
2501+
call insert(commands[name], command)
25022502
endfor
25032503
endfor
25042504
call filter(commands, '!empty(v:val)')

0 commit comments

Comments
 (0)