Skip to content

Commit f24d5d4

Browse files
committed
Fix docs and code execution.
1 parent 46db3e7 commit f24d5d4

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

autoload/pymode/doc.vim

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@ fun! pymode#doc#Show(word) "{{{
99
py sys.stdout, _ = StringIO.StringIO(), sys.stdout
1010
py help(vim.eval('a:word'))
1111
py sys.stdout, out = _, sys.stdout.getvalue()
12-
redi @">
13-
sil!py print out
14-
redi END
1512
call pymode#TempBuffer()
16-
normal ""Pdd
13+
py vim.current.buffer.append(out.split('\n'), 0)
1714
wincmd p
1815
endif
1916
endfunction "}}}

autoload/pymode/run.vim

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
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-
redi @">
5-
py execfile(vim.eval('expand("%s:p")')) or True
6-
redi END
4+
py import StringIO
5+
py sys.stdout, _ = StringIO.StringIO(), sys.stdout
6+
py execfile(vim.eval('expand("%s:p")'), {}, {})
7+
py sys.stdout, out = _, sys.stdout.getvalue()
78
call pymode#TempBuffer()
8-
normal ""Pdd
9+
py vim.current.buffer.append(out.split('\n'), 0)
910
wincmd p
1011
endfunction "}}}

0 commit comments

Comments
 (0)