Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jamessan
Copy link
Contributor

@jamessan jamessan commented Mar 5, 2017

This just uses the existing logic in mch_can_exe to populate a buffer with the
absolute path to the binary. The Windows code was already walking
$PATH, so it seems pointless not to actually use the information.

There's no reason not to behave the same way on non-Windows platforms,
so change the code to always use mch_can_exe. With a small fix to how
mch_can_exe determines whether FullName_save is needed.

@jamessan jamessan force-pushed the absolute-progpath branch from ed150a6 to 3da23f6 Compare March 5, 2017 04:51
jamessan added 2 commits March 5, 2017 07:04
mch_can_exe will already walk $PATH, if needed, to find the executable.
Since it knows enough information to set v:progpath to an absolute path
(via SearchPath on Windows and FullName_save on Linux), let it do so.
This removes any ambiguity about what v:progpath refers to.
FullName_save was only being called for paths like "./src/vim" but
"src/vim" should also be expanded to an absolute path.
@jamessan jamessan force-pushed the absolute-progpath branch from 3da23f6 to 48211ab Compare March 5, 2017 12:04
@brammool brammool closed this in 4366319 Mar 5, 2017
@jamessan jamessan deleted the absolute-progpath branch March 5, 2017 14:15
chrisbra pushed a commit to chrisbra/vim that referenced this pull request Mar 25, 2017
Problem:    Setting v:progpath is not quite right.
Solution:   On MS-Windows add the extension. On Unix use the full path for a
            relative directory. (partly by James McCoy, closes vim#1531)
desvp pushed a commit to desvp/vim that referenced this pull request May 30, 2017
Problem:    Setting v:progpath is not quite right.
Solution:   On MS-Windows add the extension. On Unix use the full path for a
            relative directory. (partly by James McCoy, closes vim#1531)
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.

1 participant