Skip to content

Commit dc47eff

Browse files
committed
Fix code run and documentation search for windows users
1 parent dd05bfc commit dc47eff

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

autoload/pymode/doc.vim

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ fun! pymode#doc#Show(word) "{{{
22
if a:word == ''
33
echoerr "No name/symbol under cursor!"
44
else
5-
call pymode#TempBuffer()
5+
py sys.stdout, _ = StringIO.StringIO(), sys.stdout
6+
py help(vim.eval('a:word'))
7+
py sys.stdout, out = _, sys.stdout.getvalue()
68
redi @">
7-
sil!py help(vim.eval('a:word'))
9+
sil!py print out
810
redi END
11+
call pymode#TempBuffer()
912
normal Pdd
1013
wincmd p
1114
endif

autoload/pymode/run.vim

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
" DESC: Save file if it modified and run python code
22
fun! pymode#run#Run(line1, line2) "{{{
33
if &modifiable && &modified | write | endif
4-
let f = expand("%:p")
5-
call pymode#TempBuffer()
64
redi @">
7-
exe "sil!py execfile('" . l:f . "')"
5+
sil!py execfile(vim.eval('expand("%s:p")'))
86
redi END
7+
call pymode#TempBuffer()
98
normal Pdd
109
wincmd p
1110
endfunction "}}}

plugin/pymode.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ endif
2222
" DESC: Fix python path
2323
if !pymode#Default('g:pymode_path', 1) || g:pymode_path
2424
python << EOF
25-
import sys, vim, os
25+
import sys, vim, os, StringIO
2626

2727
curpath = vim.eval("getcwd()")
2828
libpath = os.path.join(os.path.dirname(os.path.dirname(

0 commit comments

Comments
 (0)