diff --git a/autoload/pymode.vim b/autoload/pymode.vim index c518c41..4e9fd95 100644 --- a/autoload/pymode.vim +++ b/autoload/pymode.vim @@ -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 diff --git a/ftplugin/python/pymode.vim b/ftplugin/python/pymode.vim index d5fe8ab..00466ec 100644 --- a/ftplugin/python/pymode.vim +++ b/ftplugin/python/pymode.vim @@ -91,6 +91,8 @@ if g:pymode_lint " au! BufLeave call pymode#lint#stop() end + " Set commands + exe "nnoremap " g:pymode_lint_bind ":call pymode#run_pymode_lint()" endif " Show python documentation diff --git a/plugin/pymode.vim b/plugin/pymode.vim index 1215640..7fd24ad 100644 --- a/plugin/pymode.vim +++ b/plugin/pymode.vim @@ -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", 'L') call pymode#default("g:pymode_lint_on_write", 1) " Check code every save (every) @@ -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 @@ -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 diff --git a/pymode/rope.py b/pymode/rope.py index 9888db7..496ad87 100644 --- a/pymode/rope.py +++ b/pymode/rope.py @@ -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)