Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: image path issue with msys2/vim #604

Merged
merged 2 commits into from
Oct 14, 2023
Merged

Conversation

zhenggennj
Copy link
Contributor

  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

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
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'.
@iamcco iamcco merged commit 886dea0 into iamcco:master Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants