Closed christianrickert closed 1 year ago
Thanks for investigating this issue! Paths are tough… If you could make a PR out of that it would be great!
Btw, what do echo exists('+shellslash')
and echo &shellslash
print in your environment? Does Colortemplate work if you add set shellslash=1
in your vimrc?
Btw, what do
echo exists('+shellslash')
andecho &shellslash
print in your environment? Does Colortemplate work if you addset shellslash=1
in your vimrc?
echo exists('shellslash')
" 1
echo &shellslash
" 0
set shellslash
echo &shellslash
" 1
:edit vimfiles\vim-plug\vim-colortemplate\templates\dark.colortemplate
" E518, see below.
The current master should solve this issue, but I cannot test it on Windows. Can you please check and report whether it's fixed for you?
Closing as fixed, as per your comment here: https://github.com/lifepillar/vim-colortemplate/commit/bef949cc1137501442df9c65ff7fb9dd14347d38#commitcomment-115557784
Colortemplate: v2.2.0 gVIM: v9.0.1425
The installation of
vim-colorplate
withvim-plug
ran without issues.Next I ran the
:edit
command similarly to theReadme
example:The
:edit
command triggers an error message:I have tried to use forward slashes instead of backslashes for the
:edit
command, but the error message is identical. The corresponding code producing the error prepares and finally sets the value of theruntime_path
variable:A FEW HOURS LATER...
It looks like the
:h
modifier for theexpand
function is insufficient to preserve the space character in the head of the full file path. The:h:S
modifier would be suitable to escape special/whitespace characters in the path string for both theexpand
and thefnamemodify
functionsWith these modifications, the path expansion is only ever evaluated once and the
b:colortemplate_outdir
is assigned a string with the file path to thetemplates
folder:C:\Users\Christian Rickert\vimfiles\vim-plug\vim-colortemplate\templates
. In case the path expansion doesn't yield any result (set tolet b:colortemplate_head = ''
for testing), the variable is instead assigned a string with the file path to the current working directory:C:\Users\Christian Rickert
As a result, the value of the
runtime_path
variable is properly set and the error message disappears.@lifepillar If you agree with this proposed change, I would create a pull request.