Skip to content

Commit

Permalink
neomake#utils#ExpandArgs: return a copy
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Feb 23, 2018
1 parent fb6cf68 commit 3ec9f99
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion autoload/neomake.vim
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ function! s:command_maker_base._bind_args() abort dict
endif
let args_is_list = type(args) == type([])
if args_is_list
call neomake#utils#ExpandArgs(args)
let args = neomake#utils#ExpandArgs(args)
endif
let self.args = args
endfunction
Expand Down
2 changes: 1 addition & 1 deletion autoload/neomake/utils.vim
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ function! neomake#utils#ExpandArgs(args) abort
" \\% is expanded to \\file.ext
" %% becomes %
" % must be followed with an expansion keyword
let ret = map(a:args,
let ret = map(copy(a:args),
\ 'substitute(v:val, '
\ . '''\(\%(\\\@<!\\\)\@<!%\%(%\|\%(:[phtre]\+\)*\)\ze\)\w\@!'', '
\ . '''\=(submatch(1) == "%%" ? "%" : expand(submatch(1)))'', '
Expand Down
3 changes: 1 addition & 2 deletions tests/utils.vader
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,7 @@ Execute (neomake#utils#ExpandArgs):
\ '\~',
\ ]

call neomake#utils#ExpandArgs(args)
AssertEqual expected_args, args
AssertEqual expected_args, neomake#utils#ExpandArgs(args)
AssertEqual isk, &iskeyword
bwipe

Expand Down

0 comments on commit 3ec9f99

Please sign in to comment.