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 expandHome() not expanding $HOME #4449
Conversation
Travis tests have failedHey @CVVPK, Node.js: 8if [[ $(git diff-index HEAD -- *.js *.ts *.md) ]]; then git diff; echo "Prettier Failed. Run `gulp forceprettier` and commit changes to resolve."; exit 1; fi
npm test
TravisBuddy Request Identifier: 026cbf60-2c18-11ea-9b13-1f3f6380198b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a new test in https://github.com/VSCodeVim/Vim/blob/master/test/configuration/vimrcKeyRemappingBuilder.test.ts
or create a new test file in the same folder.
Thanks, I couldn't find any other tests for |
What this PR does / why we need it:
Since
config.vimrc.path
is a raw string we need to correctly expand~/<PathToVimrc>
and$HOME/<PathToVimrc>
to a valid path e.g.home/user/<PathToVimrc>
. We do this inside ofVimrcImpl.expandHome()
by usingprocess.env.HOME
but previously only the case of~
was being considered.This PR changes the way we were getting the
<PathToVimrc>
by using a regex that matches anything that follows~
or$HOME
at the beginning of line.Which issue(s) this PR fixes
Fixes #4384
Special notes for your reviewer:
I agree with the suggestion to add a unit test for this, but I'm unsure where to add it.I added two tests inside a new file
test/configuration/vimrc.test.ts