mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-22 14:20:15 +08:00
Get a random number from win32 cmd.exe
This commit is contained in:
parent
4265798d4b
commit
86e73cade7
|
@ -229,6 +229,8 @@ function! s:rand(max) abort
|
|||
if has("reltime")
|
||||
let timerstr=reltimestr(reltime())
|
||||
let number=split(timerstr, '\.')[1]+0
|
||||
elseif has("win32") && &shell =~ 'cmd'
|
||||
let number=system("echo %random%")+0
|
||||
else
|
||||
" best effort, bash and zsh provide $RANDOM
|
||||
" cmd.exe on windows provides %random%, but expand()
|
||||
|
|
Loading…
Reference in New Issue
Block a user