-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Better OSX detection #853
Conversation
nerdtree_plugin/fs_menu.vim
Outdated
if has("unix") | ||
let s:uname = system("uname") | ||
let stat_cmd = 'stat -c "%s" ' | ||
if s:uname == "Darwin\n" |
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.
Change this operator to =~?
and remove the \n
. The case-insensitive regex will help future-proof the if statement. See :h expr-=~?
.
nerdtree_plugin/fs_menu.vim
Outdated
let stat_cmd = 'stat -f "%z" ' | ||
else | ||
let stat_cmd = 'stat -c "%s" ' | ||
if has("unix") |
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.
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.
Thanks, @bubba-h57, for the improvement. Good catch! |
@PhilRunninger Thanks for maintaining a great plugin that makes my life easier. :-) |
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.