Permalink
Browse files

scripts.vim: 支持浮点数结果显示

  • Loading branch information...
1 parent fb08a97 commit 8d565010116c7df2261e971cf8cb9a010ea55820 @lilydjwg committed Jul 25, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 plugin/scratch.vim
View
@@ -133,7 +133,11 @@ function s:scratch_eval(engine)
let rstr = system('python3 -c ''print('.exp.')''')
let r = split(rstr, '\n')
endif
- call append('.', r)
+ if type(r) == type(0.0)
+ call append('.', printf('%lg', r))
+ else
+ call append('.', r)
+ endif
startinsert!
endfunction
function! s:BackupScratchBuffer()

0 comments on commit 8d56501

Please sign in to comment.