Skip to content

Commit 03caf46

Browse files
committed
xolox#misc#os#is_mac might be slow: call it only when required
This speeds of Vim loading with easytags on Linux a bit, because it won't shell out (to `uname`) anymore when the autoloading of vim-misc is being triggered.
1 parent 6ce98ee commit 03caf46

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

autoload/xolox/misc/path.vim

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
" URL: http://peterodding.com/code/vim/misc/
66

77
let s:windows_compatible = xolox#misc#os#is_win()
8-
let s:mac_os_x_compatible = xolox#misc#os#is_mac()
98

109
function! xolox#misc#path#which(...) " {{{1
1110
" Scan the executable search path (`$PATH`) for one or more external
@@ -212,7 +211,7 @@ function! xolox#misc#path#encode(path) " {{{1
212211
" to encode special characters.
213212
if s:windows_compatible
214213
let mask = '[*|\\/:"<>?%]'
215-
elseif s:mac_os_x_compatible
214+
elseif xolox#misc#os#is_mac()
216215
let mask = '[\\/%:]'
217216
else
218217
let mask = '[\\/%]'

0 commit comments

Comments
 (0)