Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: image path issue with msys2/vim (iamcco#604)
* fix: image path issue with msys2/vim 1) Issue background a) on 'mingw32' terminal b) executable 'vim' in /usr/bin c) executable 'node' in /mingw32/bin. d) plugin 'markdow-preview.nvim' in ~/.vim/plugged e) app/route.js:68 fileDir is a unix path f) image missing in browser preview 2) Issue fixing add code to app/route.js: a) extract info from environment variable MINGW_HOME b) prefixing imgPath with sth. like "E:\msys64\" 3) No issue alternative a) on 'ucrt64' terminal b) executable 'nvim' in /ucrt64/bin c) executable 'node' in /ucrt64/bin d) plugin 'markdown-preview.nvim' in ~/.vim/plugged e) app/route.js:68 fileDir is a win path f) image ok in browser preview * fix: now work on any windows disk device 1) Based on info from MINGW_HOME is error-prone. Maybe the document is located on a windisk other than that of msys2 installation. 2) use 'cygpath.exe' to convert unix-like 'fileDir' to win-like one. 3) the conversion operation must follow the first assignment of 'fileDir'.
- Loading branch information