Skip to content

Commit 757c08d

Browse files
committed
Add debug configuration
1 parent 550f55c commit 757c08d

File tree

4 files changed

+29
-6
lines changed

4 files changed

+29
-6
lines changed

README.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,16 @@ Then rebuild **helptags** in vim::
9898
Troubleshooting
9999
===============
100100

101-
If your python-mode doesn't work: open any python file and type: ::
101+
If your python-mode doesn't work:
102102

103-
:call pymode#troubleshooting#test()
103+
1. Load Vim with only python-mode enabled (use `debug.vim` from pymode): ::
104+
105+
vim -u <path_to_pymode>/debug.vim
106+
107+
And try to repeat your case. If no error occurs, seems like problem isnt in the
108+
plugin.
109+
110+
2. Type `:PymodeTroubleshooting`
104111

105112
And fix any warnings or copy the output and send it to me. (For example, by
106113
creating a `new github issue <https://github.com/klen/python-mode/issues/new>`_

autoload/pymode.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,17 @@ endfunction "}}}
106106

107107
fun! pymode#buffer_pre_write() "{{{
108108
let b:pymode_modified = &modified
109-
if g:pymode_lint_unmodified || (g:pymode_lint_on_write && b:pymode_modified)
110-
call pymode#debug('check code')
111-
call pymode#lint#check()
112-
endif
113109
endfunction
114110

115111
fun! pymode#buffer_post_write() "{{{
116112
if b:pymode_modified && g:pymode_rope_regenerate_on_write
117113
call pymode#debug('regenerate')
118114
call pymode#rope#regenerate()
119115
endif
116+
if g:pymode_lint_unmodified || (g:pymode_lint_on_write && b:pymode_modified)
117+
call pymode#debug('check code')
118+
call pymode#lint#check()
119+
endif
120120
endfunction "}}}
121121

122122
fun! pymode#debug(msg) "{{{

debug.vim

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
" Use this settings for testing the plugin.
2+
" Run vim with command
3+
"
4+
" $ vim -u debug.py
5+
"
6+
" Only python-mode will be loaded.
7+
8+
9+
execute('set rtp+='. expand('<sfile>:p:h'))
10+
set rtp -=$HOME/.vim
11+
set rtp -=$HOME/.vim/after
12+
set nocp
13+
syntax enable

plugin/pymode.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ if !g:pymode || &cp
1313
finish
1414
endif
1515

16+
" Pymode needs
17+
filetype plugin on
18+
1619
" OPTIONS: {{{
1720

1821
" Vim Python interpreter. Set to 'disable' for remove python features.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy