Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions autoload/pymode.vim
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,19 @@ fun! pymode#buffer_pre_write() "{{{
let b:pymode_modified = &modified
endfunction

fun! pymode#run_pymode_lint() "{{{
if g:pymode_rope
if b:pymode_modified && g:pymode_rope_regenerate_on_write
call pymode#debug('regenerate')
call pymode#rope#regenerate()
endif
endif
if g:pymode_lint
call pymode#debug('check code')
call pymode#lint#check()
endif
endfunction "}}}

fun! pymode#buffer_post_write() "{{{
if g:pymode_rope
if b:pymode_modified && g:pymode_rope_regenerate_on_write
Expand Down
2 changes: 2 additions & 0 deletions ftplugin/python/pymode.vim
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ if g:pymode_lint
" au! BufLeave <buffer> call pymode#lint#stop()
end

" Set commands
exe "nnoremap <silent> <buffer> " g:pymode_lint_bind ":call pymode#run_pymode_lint()<CR>"
endif

" Show python documentation
Expand Down
5 changes: 3 additions & 2 deletions plugin/pymode.vim
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ call pymode#default('g:pymode_lint_async', 1)
call pymode#default('g:pymode_lint_async_updatetime', 1000)

" Check code every save if file has been modified
call pymode#default("g:pymode_lint_bind", '<leader>L')
call pymode#default("g:pymode_lint_on_write", 1)

" Check code every save (every)
Expand All @@ -107,7 +108,7 @@ call pymode#default("g:pymode_lint_ignore", "")
" Select errors and warnings (e.g. E4,W)
call pymode#default("g:pymode_lint_select", "")

" Auto open cwindow if any errors has been finded
" Auto open cwindow if any errors has been found
call pymode#default("g:pymode_lint_cwindow", 1)

" If not emply, errors will be sort by defined relevance
Expand Down Expand Up @@ -157,7 +158,7 @@ call pymode#default('g:pymode_rope_project_root', '')
" Configurable rope project folder (always relative to project root)
call pymode#default('g:pymode_rope_ropefolder', '.ropeproject')

" If project hasnt been finded in current working directory, look at parents directory
" If project hasnt been found in current working directory, look at parents directory
call pymode#default('g:pymode_rope_lookup_project', 0)

" Enable Rope completion
Expand Down
2 changes: 1 addition & 1 deletion pymode/rope.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
def look_ropeproject(path):
""" Search for ropeproject in current and parent dirs.

:return str|None: A finded path
:return str|None: A found path

"""
env.debug('Look project', path)
Expand Down