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

Better OSX detection #853

Merged
merged 3 commits into from Jun 15, 2018
Merged

Better OSX detection #853

merged 3 commits into from Jun 15, 2018

Conversation

bubba-h57
Copy link
Contributor

Neovim does not support an osx feature to test for. This PR implements a more generic test for the OSX operating system in order to ensure the correct stat command is used.

if has("unix")
let s:uname = system("uname")
let stat_cmd = 'stat -c "%s" '
if s:uname == "Darwin\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this operator to =~? and remove the \n. The case-insensitive regex will help future-proof the if statement. See :h expr-=~?.

let stat_cmd = 'stat -f "%z" '
else
let stat_cmd = 'stat -c "%s" '
if has("unix")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking a wider look at this file, I noticed that this if has("unix") statement has already been done on line 41, so we don't need it again here.

@PhilRunninger PhilRunninger merged commit d6032c8 into preservim:master Jun 15, 2018
@PhilRunninger
Copy link
Member

Thanks, @bubba-h57, for the improvement. Good catch!

@bubba-h57
Copy link
Contributor Author

@PhilRunninger Thanks for maintaining a great plugin that makes my life easier. :-)

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.

None yet

2 participants