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

Commit8e17f6e

Browse files
committed
Merge branch 'feature/0.6.5' into develop
2 parents9f976bb +ccd7dd5 commit8e17f6e

File tree

79 files changed

+6985
-2959
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+6985
-2959
lines changed

‎Changelog.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
Changelog
22
=========
33

4+
## 2012-08-02 0.6.5
5+
-------------------
6+
* Updated Pep8 to version 1.3.3
7+
* Updated Pylint to version 0.25.2
8+
* Fixed virtualenv support for windows users
9+
* Added pymode modeline ':help PythonModeModeline'
10+
* Added diagnostic tool ':call pymode#troubleshooting#Test()'
11+
* Added `PyLintAuto` command ':help PyLintAuto'
12+
* Code checking is async operation now
13+
* More, more fast the pymode folding
14+
* Repaired execution of python code
15+
416
## 2012-05-24 0.6.4
517
-------------------
618
* Add 'pymode_paths' option

‎Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.PHONY: clean
2+
clean:
3+
find. -name"*.pyc" -delete

‎README.rst

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,17 @@ See (very old) screencast here: http://t.co/3b0bzeXA (sorry for quality, this is
3030
Changelog
3131
=========
3232

33-
## 2012-04-10 0.6.2
33+
## 2012-08-02 0.6.5
3434
-------------------
35-
* Fix pymode_run for "unnamed" clipboard
36-
* Add 'pymode_lint_mccabe_complexity' option
37-
* Update Pep8 to version 1.0.1
38-
* Warning! Change 'pymode_rope_goto_def_newwin' option
39-
for open "goto definition" in new window, set it to 'new' or 'vnew'
40-
for horizontally or vertically split
41-
If you use default behaviour (in the same buffer), not changes needed.
35+
* Updated Pep8 to version 1.3.3
36+
* Updated Pylint to version 0.25.2
37+
* Fixed virtualenv support for windows users
38+
* Added pymode modeline ':help PythonModeModeline'
39+
* Added diagnostic tool ':call pymode#troubleshooting#Test()'
40+
* Added `PyLintAuto` command ':help PyLintAuto'
41+
* Code checking is async operation now
42+
* More, more fast the pymode folding
43+
* Repaired execution of python code
4244

4345

4446
Requirements
@@ -90,6 +92,16 @@ Then rebuild **helptags** in vim::
9092
must be enabled for use python-mode.
9193

9294

95+
Troubleshooting
96+
===============
97+
98+
If your python-mode dont work, type command: ::
99+
100+
:call pymode#troubleshooting#Test()
101+
102+
And fix warnings or copy output and send it to me (ex. with github issue).
103+
104+
93105
Settings
94106
========
95107

@@ -385,6 +397,8 @@ PyLintCheckerToggle Toggle code checker (pylint, pyflakes)
385397
-------------------- -------------
386398
PyLint Check current buffer
387399
-------------------- -------------
400+
PyLintAuto Automatic fix PEP8 errors
401+
-------------------- -------------
388402
Pyrun Run current buffer in python
389403
==================== =============
390404

@@ -456,6 +470,10 @@ Copyright (C) 2012 Kirill Klenov (klen_)
456470
Copyright (C) 2006 Johann C. Rocholl <johann@rocholl.net>
457471
http://github.com/jcrocholl/pep8
458472

473+
**autopep8**:
474+
Copyright (c) 2012 hhatto <hhatto.jp@gmail.com>
475+
https://github.com/hhatto/autopep8
476+
459477
**Python syntax for vim**
460478
Copyright (c) 2010 Dmitry Vasiliev
461479
http://www.hlabs.spb.ru/vim/python.vim
@@ -470,6 +488,8 @@ If you like this plugin, you can send me postcard :)
470488
My address is here: "Russia, 143401, Krasnogorsk, Shkolnaya 1-19" to "Kirill Klenov".
471489
**Thanks for support!**
472490

491+
Version 0.6.5: I still haven't received any postcard, guys :(
492+
473493

474494
.. _GNU lesser general public license:http://www.gnu.org/copyleft/lesser.html
475495
.. _klen:http://klen.github.com/

‎autoload/pymode.vim

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,19 @@ fun! pymode#Default(name, default) "{{{
1212
endfunction"}}}
1313

1414

15+
fun!pymode#Option(name)"{{{
16+
17+
let name='b:pymode_' .a:name
18+
ifexists(name)
19+
returneval(name)
20+
endif
21+
22+
let name='g:pymode_' .a:name
23+
returneval(name)
24+
25+
endfunction"}}}
26+
27+
1528
fun!pymode#QuickfixOpen(onlyRecognized, holdCursor, maxHeight, minHeight, jumpError)"{{{
1629
" DESC: Open quickfix window
1730
"
@@ -22,7 +35,7 @@ fun! pymode#QuickfixOpen(onlyRecognized, holdCursor, maxHeight, minHeight, jumpE
2235
exemax([min([line("$"),a:maxHeight]),a:minHeight]) ."wincmd _"
2336
ifa:jumpError
2437
cc
25-
elseifa:holdCursor
38+
elseif!a:holdCursor
2639
wincmdp
2740
endif
2841
else
@@ -106,7 +119,7 @@ fun! pymode#WideMessage(msg) "{{{
106119
letx=&ruler |lety=&showcmd
107120
setnorulernoshowcmd
108121
redraw
109-
echostrpart(a:msg,0, &columns-1)
122+
echohlDebug |echostrpart(a:msg,0, &columns-1) |echohlnone
110123
let &ruler=x |let &showcmd=y
111124
endfunction"}}}
112125

@@ -149,4 +162,16 @@ fun! pymode#BlockEnd(lnum, ...) "{{{
149162
endfunction"}}}
150163

151164

165+
fun!pymode#Modeline()"{{{
166+
letmodeline=getline(prevnonblank('$'))
167+
ifmodeline=~'^#\s\+pymode:'
168+
forexinsplit(modeline,':')[1:]
169+
let [name, value]=split(ex,'=')
170+
let {'b:pymode_'.name}= value
171+
endfor
172+
endif
173+
auBufRead<buffer>callpymode#Modeline()
174+
endfunction"}}}
175+
176+
152177
" vim:fdm=marker:fdl=0

‎autoload/pymode/breakpoint.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,14 @@ fun! pymode#breakpoint#Set(lnum) "{{{
77
callappend(line('.')-1,repeat('',indent(plnum)).g:pymode_breakpoint_cmd)
88
normalk
99
endif
10+
11+
" Disable lint
12+
let pymode_lint=g:pymode_lint
13+
letg:pymode_lint=0
14+
15+
" Save file
1016
if &modifiable&& &modified |write |endif
17+
18+
letg:pymode_lint= pymode_lint
19+
1120
endfunction"}}}

‎autoload/pymode/folding.vim

Lines changed: 19 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
" Python-mode folding functions
22

33

4-
lets:defpat='^\s*\(@\|class\s.*:\|def\s\)'
4+
lets:blank_regex='^\s*$'
5+
lets:def_regex='^\s*\(class\|def\) \w\+'
56

67

78
fun!pymode#folding#text()" {{{
@@ -25,81 +26,34 @@ fun! pymode#folding#text() " {{{
2526
endfunction"}}}
2627

2728

28-
fun!pymode#folding#indent(lnum)"{{{
29-
letindent=indent(pymode#BlockStart(a:lnum))
30-
returnindent ?indent+ &shiftwidth :0
31-
endfunction"}}}
32-
33-
3429
fun!pymode#folding#expr(lnum)"{{{
30+
3531
letline=getline(a:lnum)
3632
letindent=indent(a:lnum)
3733

38-
ifline==''
39-
returngetline(a:lnum+1)=='' ?'=' :'-1'
40-
endif
41-
42-
ifline=~s:defpat&&getline(prevnonblank(a:lnum-1))!~'^\s*@'
43-
letn=a:lnum
44-
whilegetline(n)=~'^\s*@'
45-
letn=nextnonblank(n+1)
46-
endwhile
47-
ifgetline(n)=~s:defpat
48-
return">".(indent/&shiftwidth+1)
49-
endif
34+
ifline=~s:def_regex
35+
return">".(indent / &shiftwidth+1)
5036
endif
5137

52-
letp=prevnonblank(a:lnum-1)
53-
whilep>0&&getline(p)=~'^\s*#'
54-
letp=prevnonblank(p-1)
55-
endwhile
56-
let pind=indent(p)
57-
ifgetline(p)=~s:defpat&&getline(prevnonblank(a:lnum-1))!~'^\s*@'
58-
let pind= pind+ &shiftwidth
59-
elseifp==0
60-
let pind=0
38+
ifline=~'^\s*@'
39+
return-1
6140
endif
6241

63-
if (indent>0&&indent==pind)||indent>pind
64-
return'='
65-
elseifindent==0
66-
if pind==0&&line=~'^#'
67-
return0
68-
elseifline!~'^#'
69-
if0<pind&&line!~'^else\s*:\|^except.*:\|^elif.*:\|^finally\s*:'
70-
return'>1'
71-
elseif0==pind&&getline(prevnonblank(a:lnum-1))=~'^\s*#'
72-
return'>1'
73-
else
74-
return'='
75-
endif
76-
endif
77-
letn=nextnonblank(a:lnum+1)
78-
whilen>0&&getline(n)=~'^\s*#'
79-
letn=nextnonblank(n+1)
80-
endwhile
81-
ifindent(n)==0
82-
return0
83-
else
42+
ifline=~s:blank_regex
43+
let prev_line=getline(a:lnum-1)
44+
if prev_line=~s:blank_regex
8445
return-1
85-
end
86-
endif
87-
let blockindent=indent(pymode#BlockStart(a:lnum))+ &shiftwidth
88-
if blockindent==0
89-
return1
46+
else
47+
returnfoldlevel(prevnonblank(a:lnum))
48+
endif
9049
endif
91-
letn=nextnonblank(a:lnum+1)
92-
whilen>0&&getline(n)=~'^\s*#'
93-
letn=nextnonblank(n+1)
94-
endwhile
95-
let nind=indent(n)
96-
ifline=~'^\s*#'&&indent>=nind
97-
return-1
98-
elseifline=~'^\s*#'
99-
return nind / &shiftwidth
100-
else
101-
return blockindent / &shiftwidth
50+
51+
ifindent==0
52+
return0
10253
endif
54+
55+
return'='
56+
10357
endfunction"}}}
10458

10559

‎autoload/pymode/lint.vim

Lines changed: 47 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,39 @@
1-
fun!pymode#lint#Check()
2-
1+
fun!pymode#lint#Check()"{{{
2+
" DESC: Run checkers on current file.
3+
"
34
if!g:pymode_lint |return |endif
45

5-
letb:errors= {}
6-
76
if &modifiable&& &modified
87
try
98
write
109
catch/E212/
1110
echohlError |echo"File modified and I can't save it. Cancel code checking." |echohl None
1211
return0
1312
endtry
14-
endif
13+
endif
1514

16-
pycheck_file()
15+
letg:pymode_lint_buffer=bufnr('%')
1716

18-
ifg:qf_list!=b:qf_list
17+
py lint.check_file()
1918

20-
callsetqflist(b:qf_list,'r')
19+
endfunction" }}}
2120

22-
letg:qf_list=b:qf_list
2321

24-
ifg:pymode_lint_message
25-
forvinb:qf_list
26-
letb:errors[v['lnum']]=v['text']
27-
endfor
28-
callpymode#lint#show_errormessage()
29-
endif
22+
fun!pymode#lint#Parse()
23+
" DESC: Parse result of code checking.
24+
"
25+
callsetqflist(g:qf_list,'r')
3026

31-
ifg:pymode_lint_cwindow
32-
callpymode#QuickfixOpen(0,g:pymode_lint_hold,g:pymode_lint_maxheight,g:pymode_lint_minheight,g:pymode_lint_jump)
33-
endif
27+
ifg:pymode_lint_signs
28+
callpymode#PlaceSigns()
29+
endif
3430

31+
ifg:pymode_lint_cwindow
32+
callpymode#QuickfixOpen(0,g:pymode_lint_hold,g:pymode_lint_maxheight,g:pymode_lint_minheight,g:pymode_lint_jump)
3533
endif
3634

37-
ifg:pymode_lint_signs
38-
callpymode#PlaceSigns()
35+
if!len(g:qf_list)
36+
callpymode#WideMessage('Code checking is completed. No errors found.')
3937
endif
4038

4139
endfunction
@@ -74,13 +72,34 @@ endfunction "}}}
7472

7573

7674
fun!pymode#lint#show_errormessage()"{{{
77-
if!len(b:errors) |return |endif
78-
letcursor=getpos(".")
79-
ifhas_key(b:errors,l:cursor[1])
80-
callpymode#WideMessage(b:errors[l:cursor[1]])
81-
letb:show_message=1
82-
else
83-
letb:show_message=0
84-
echo
75+
ifg:pymode_lint_buffer!=bufnr('%')
76+
return0
8577
endif
78+
let errors=getqflist()
79+
if!len(errors)
80+
return
81+
endif
82+
let [_,line, _, _]=getpos(".")
83+
forein errors
84+
ife['lnum']==line
85+
callpymode#WideMessage(e['text'])
86+
else
87+
echo
88+
endif
89+
endfor
8690
endfunction" }}}
91+
92+
93+
fun!pymode#lint#Auto()"{{{
94+
if &modifiable&& &modified
95+
try
96+
write
97+
catch/E212/
98+
echohlError |echo"File modified and I can't save it. Cancel operation." |echohl None
99+
return0
100+
endtry
101+
endif
102+
py auto.fix_current_file()
103+
cclose
104+
edit
105+
endfunction"}}}

‎autoload/pymode/queue.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fun!pymode#queue#Poll()"{{{
2+
py queue.check_task()
3+
callfeedkeys("\<Up>\<Down>",'t')
4+
endfunction"}}}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp