Skip to content

Commit d854dc2

Browse files
author
vim-IDE
committed
Merge branch 'develop' of https://github.com/klen/python-mode into develop
2 parents 1234d71 + 755e99f commit d854dc2

File tree

9 files changed

+27
-14
lines changed

9 files changed

+27
-14
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Contributors:
3838
* Piet Delport (http://github.com/pjdelport);
3939
* Robert David Grant (http://github.com/bgrant);
4040
* Ronald Andreu Kaiser (http://github.com/cathoderay);
41+
* Samir Benmendil (https://github.com/Ram-Z)
4142
* Sorin Ionescu (sorin-ionescu);
4243
* Steve Losh (http://github.com/sjl);
4344
* Tommy Allen (https://github.com/tweekmonster)

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ See (very old) screencast here: http://www.youtube.com/watch?v=67OZNp9Z0CQ
4040
(sorry for quality, this is my first screencast) Another old presentation here:
4141
http://www.youtube.com/watch?v=YhqsjUUHj6g
4242

43-
**To read python-mode documentation in Vim, see** ``:help pymode.txt``
43+
**To read python-mode documentation in Vim, see** ``:help pymode``
4444

4545

4646
.. contents::
@@ -62,7 +62,7 @@ Using pathogen (recommended)
6262

6363
% cd ~/.vim
6464
% mkdir -p bundle && cd bundle
65-
% git clone git://github.com/klen/python-mode.git
65+
% git clone https://github.com/klen/python-mode.git
6666

6767
- Enable `pathogen <https://github.com/tpope/vim-pathogen>`_
6868
in your ``~/.vimrc``: ::
@@ -81,7 +81,7 @@ Manually
8181
--------
8282
::
8383

84-
% git clone git://github.com/klen/python-mode.git
84+
% git clone https://github.com/klen/python-mode.git
8585
% cd python-mode
8686
% cp -R * ~/.vim
8787

autoload/pymode.vim

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ endfunction "}}}
7676

7777
" DESC: Remove unused whitespaces
7878
fun! pymode#trim_whitespaces() "{{{
79-
let cursor_pos = getpos('.')
80-
silent! %s/\s\+$//
81-
call setpos('.', cursor_pos)
79+
if g:pymode_trim_whitespaces
80+
let cursor_pos = getpos('.')
81+
silent! %s/\s\+$//
82+
call setpos('.', cursor_pos)
83+
endif
8284
endfunction "}}}
8385

8486

autoload/pymode/breakpoint.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fun! pymode#breakpoint#init() "{{{
1717

1818
from imp import find_module
1919

20-
for module in ('pudb', 'ipdb'):
20+
for module in ('wdb', 'pudb', 'ipdb'):
2121
try:
2222
find_module(module)
2323
vim.command('let g:pymode_breakpoint_cmd = "import %s; %s.set_trace() # XXX BREAKPOINT"' % (module, module))

autoload/pymode/doc.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ fun! pymode#doc#show(word) "{{{
2929
setlocal nomodifiable
3030
setlocal nomodified
3131
setlocal filetype=rst
32+
if g:pymode_doc_vertical
33+
wincmd L
34+
endif
3235
wincmd p
3336

3437
endfunction "}}}

autoload/pymode/folding.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fun! pymode#folding#text() " {{{
1818
while getline(fs) !~ s:def_regex && getline(fs) !~ s:doc_begin_regex
1919
let fs = nextnonblank(fs + 1)
2020
endwhile
21-
if getline(fs) =~ s:doc_begin_regex
21+
if getline(fs) =~ s:doc_end_regex && getline(fs) =~ s:doc_begin_regex
2222
let fs = nextnonblank(fs + 1)
2323
endif
2424
let line = getline(fs)
@@ -50,6 +50,10 @@ fun! pymode#folding#expr(lnum) "{{{
5050
endif
5151

5252
if line =~ s:def_regex
53+
" single line def
54+
if indent(a:lnum) >= indent(a:lnum+1)
55+
return '='
56+
endif
5357
" Check if last decorator is before the last def
5458
let decorated = 0
5559
let lnum = a:lnum - 1

doc/pymode.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,6 @@ Setup default python options *'g:pymode_options'*
9898
>
9999
let g:pymode_options = 1
100100
101-
Setup max line length *'g:pymode_options_max_line_length'*
102-
>
103-
let g:pymode_options_max_line_length = 79
104-
105101
If this option is set to 1, pymode will enable the following options for
106102
python buffers: >
107103
@@ -115,6 +111,10 @@ python buffers: >
115111
setlocal commentstring=#%s
116112
setlocal define=^\s*\\(def\\\\|class\\)
117113
114+
Setup max line length *'g:pymode_options_max_line_length'*
115+
>
116+
let g:pymode_options_max_line_length = 79
117+
118118
Enable colorcolumn display at max_line_length *'g:pymode_options_colorcolumn'*
119119
>
120120
let g:pymode_options_colorcolumn = 1

plugin/pymode.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ call pymode#default("g:pymode_options", 1)
5252
call pymode#default("g:pymode_options_max_line_length", 80)
5353
call pymode#default("g:pymode_options_colorcolumn", 1)
5454

55+
" Enable/disable vertical display of python documentation
56+
call pymode#default("g:pymode_doc_vertical", 0)
57+
5558
" Minimal height of pymode quickfix window
5659
call pymode#default('g:pymode_quickfix_maxheight', 6)
5760

syntax/python.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ endif
8080
syn match pythonFunction "\%(\%(def\s\|@\)\s*\)\@<=\h\%(\w\|\.\)*" contained nextgroup=pythonVars
8181
syn region pythonVars start="(" skip=+\(".*"\|'.*'\)+ end=")" contained contains=pythonParameters transparent keepend
8282
syn match pythonParameters "[^,]*" contained contains=pythonParam skipwhite
83-
syn match pythonParam "[^,]*" contained contains=pythonExtraOperator,pythonLambdaExpr,pythonBuiltinObj,pythonBuiltinType,pythonConstant,pythonString,pythonNumber,pythonBrackets,pythonSelf skipwhite
83+
syn match pythonParam "[^,]*" contained contains=pythonExtraOperator,pythonLambdaExpr,pythonBuiltinObj,pythonBuiltinType,pythonConstant,pythonString,pythonNumber,pythonBrackets,pythonSelf,pythonComment skipwhite
8484
syn match pythonBrackets "{[(|)]}" contained skipwhite
8585

8686
syn keyword pythonStatement class nextgroup=pythonClass skipwhite
8787
syn match pythonClass "\%(\%(class\s\)\s*\)\@<=\h\%(\w\|\.\)*" contained nextgroup=pythonClassVars
8888
syn region pythonClassVars start="(" end=")" contained contains=pythonClassParameters transparent keepend
89-
syn match pythonClassParameters "[^,\*]*" contained contains=pythonBuiltin,pythonBuiltinObj,pythonBuiltinType,pythonExtraOperatorpythonStatement,pythonBrackets,pythonString skipwhite
89+
syn match pythonClassParameters "[^,\*]*" contained contains=pythonBuiltin,pythonBuiltinObj,pythonBuiltinType,pythonExtraOperatorpythonStatement,pythonBrackets,pythonString,pythonComment skipwhite
9090

9191
syn keyword pythonRepeat for while
9292
syn keyword pythonConditional if elif else

0 commit comments

Comments
 (0)