plugin: make use of rand() function from vim 8.1.2342

This commit is contained in:
Christian Brabandt 2019-11-25 17:13:33 +01:00
parent 19c655b420
commit 81fdc3b988
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
1 changed files with 4 additions and 1 deletions

View File

@ -251,7 +251,10 @@ function! s:airline_extensions()
endfunction
function! s:rand(max) abort
if has("reltime")
if exists("*rand")
" Needs Vim 8.1.2342
let number=rand()
elseif has("reltime")
let timerstr=reltimestr(reltime())
let number=split(timerstr, '\.')[1]+0
elseif has("win32") && &shell =~ 'cmd'