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")
|
if has("reltime")
|
||||||
let timerstr=reltimestr(reltime())
|
let timerstr=reltimestr(reltime())
|
||||||
let number=split(timerstr, '\.')[1]+0
|
let number=split(timerstr, '\.')[1]+0
|
||||||
|
elseif has("win32") && &shell =~ 'cmd'
|
||||||
|
let number=system("echo %random%")+0
|
||||||
else
|
else
|
||||||
" best effort, bash and zsh provide $RANDOM
|
" best effort, bash and zsh provide $RANDOM
|
||||||
" cmd.exe on windows provides %random%, but expand()
|
" cmd.exe on windows provides %random%, but expand()
|
||||||
|
|
Loading…
Reference in New Issue