Skip to content

Commit 8f3a76f

Browse files
committed
More accurate check for 4 argument maparg()
1 parent 0e4927f commit 8f3a76f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

autoload/rails.vim

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5114,11 +5114,9 @@ function! s:set_path_options() abort
51145114
let suffixes = join(s:suffixes(assetdir), ',')
51155115
if !empty(assetdir)
51165116
let delegate = ''
5117-
if exists(':chistory')
5118-
let cfilemap = maparg('<Plug><cfile>', 'c', 0, 1)
5119-
if get(cfilemap, 'buffer') && cfilemap.expr && cfilemap.rhs !~# 'rails#\|Ruby'
5120-
let delegate = string(maparg('<Plug><cfile>', 'c'))
5121-
endif
5117+
let cfilemap = v:version + has('patch032') >= 704 ? maparg('<Plug><cfile>', 'c', 0, 1) : {}
5118+
if get(cfilemap, 'buffer') && cfilemap.expr && cfilemap.rhs !~# 'rails#\|Ruby'
5119+
let delegate = string(maparg('<Plug><cfile>', 'c'))
51225120
endif
51235121
let map = 'rails#asset_cfile('.delegate.')'
51245122
if len(suffixes)

0 commit comments

Comments
 (0)