Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb92c982

Browse files
committed
1 parent43ad3fd commitb92c982

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

‎Changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Changelog
33

44
* Get fold's expression symbol from &fillchars;
55
* Fixed error when setting g:pymode_breakpoint_cmd (expobrain);
6+
* Fixed code running;
67

78

89
## 2013-12-04 0.7.8b

‎autoload/pymode/tools/loclist.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ fun! g:PymodeLocList.show() "{{{
7070
lclose
7171
else
7272
let num=winnr()
73-
execute"lopen" .g:pymode_quickfix_maxheight
73+
lopen
7474
executemax([min([line("$"),g:pymode_quickfix_maxheight]),g:pymode_quickfix_minheight]) ."wincmd _"
7575
if num!=winnr()
7676
callsetwinvar(winnr(),'quickfix_title',self._title .' <' .self._name .'>')

‎pymode/run.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,25 @@
88
importsys
99

1010
from .environmentimportenv
11+
fromreimportcompileasre
12+
13+
14+
encoding=re(r'#[^\w]+coding:\s+utf.*$')
1115

1216

1317
defrun_code():
14-
""" Run python code in current buffer. """
18+
""" Run python code in current buffer.
19+
20+
:returns: None
21+
22+
"""
1523

1624
errors,err= [],''
1725
line1,line2=env.var('a:line1'),env.var('a:line2')
1826
lines=__prepare_lines(line1,line2)
27+
forixin (0,1):
28+
ifencoding.match(lines[ix]):
29+
lines.pop(ix)
1930

2031
context=dict(
2132
__name__='__main__',input=env.user_input,raw_input=env.user_input)
@@ -42,14 +53,14 @@ def run_code():
4253
else:
4354
err=sys.stderr.getvalue()
4455

45-
output=sys.stdout.getvalue().strip()
46-
output=env.prepare_value(output)
56+
output=sys.stdout.getvalue()
57+
output=env.prepare_value(output,dumps=False)
4758
sys.stdout,sys.stderr=stdout_,stderr_
4859

4960
errors+= [erforerinerr.splitlines()iferand"<string>"notiner]
5061

5162
env.let('l:traceback',errors[2:])
52-
env.let('l:output', [sforsinoutput.split('\n')ifs])
63+
env.let('l:output', [sforsinoutput.split('\n')])
5364

5465

5566
def__prepare_lines(line1,line2):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp