Vimscript two-dot string concatenations lead to errors
In #3 I receive the following error (while expecting to see a red one line error message):
Error detected while processing function docker_compose#command#up[2]..docker_compose#utils#check#filereadable:
line 2:
E15: Invalid expression: . ' is not exist or readable')
E116: Invalid arguments for function docker_compose#utils#message#err
docker-compose.vim's error message is displayed correctly without vim errors if I do the following changes in autoload/docker_compose/utils/message.vim (one-dot concatenations instead of two-dot, as mentioned here):
- echo s:msg_prefix .. a:msg
+ echo s:msg_prefix . a:msg
and in autoload/docker_compose/utils/check.vim
- call docker_compose#utils#message#err(a:file .. ' is not exist or readable')
+ call docker_compose#utils#message#err(a:file . ' is not exist or readable')
The same applies to all string concatenations, e.g. after executing :DockerComposeConfig docker-compose.yml I see the following:
Error detected while processing function docker_compose#command#config[5]..docker_compose#api#terminal:
line 14:
E15: Invalid expression: . ' terminal ' .. s:base_cmd .. join(a:000, ' ')
E15: Invalid expression: get(g:, 'docker_compose_open_terminal_way', 'vert') .. ' terminal ' .. s:base_cmd .. join(a:000, ' ')
It starts working only when I modify autoload/docker_compose/api.vim:
- execute get(g:, 'docker_compose_open_terminal_way', 'vert') .. ' terminal ' .. s:base_cmd .. join(a:000, ' ')
+ execute get(g:, 'docker_compose_open_terminal_way', 'vert') . ' terminal ' . s:base_cmd . join(a:000, ' ')
± % vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jun 06 2019 17:31:41)
Included patches: 1-1453
Modified by [email protected]
Compiled by [email protected]
(latest in Ubuntu 18.04 repo)
@DmitrySandalov It looks like your vim version is old. https://github.com/skanehira/docker-compose.vim#requirements
Affects latest vim in Ubuntu 19.04 as well.
± % apt-cache show vim
Version: 2:8.1.0320-1ubuntu3
± % vim --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun 07 2019 11:42:36)
Included patches: 1-320
Modified by [email protected]
Compiled by [email protected]
Did not test with Vim >= 8.1.2021 yet.