Skip to content

Commit 322da79

Browse files
committed
Fix breakpoint section
1 parent 2bbe979 commit 322da79

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

autoload/pymode/breakpoint.vim

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,18 @@ fun! pymode#breakpoint#Set(lnum) "{{{
1313
if &modifiable && &modified | noautocmd write | endif
1414

1515
endfunction "}}}
16+
17+
fun! pymode#breakpoint#SearchDebuger() "{{{
18+
19+
Python << EOF
20+
from imp import find_module
21+
22+
for module in ('pudb', 'ipdb'):
23+
try:
24+
find_module(module)
25+
vim.command('let g:pymode_breakpoint_cmd = "import %s; %s.set_trace() # XXX BREAKPOINT"' % (module, module))
26+
except ImportError:
27+
continue
28+
EOF
29+
30+
endfunction "}}}

ftplugin/python/init-pymode.vim

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,7 @@ if !pymode#Default("g:pymode_breakpoint", 1) || g:pymode_breakpoint
159159

160160
if !pymode#Default("g:pymode_breakpoint_cmd", "import pdb; pdb.set_trace() # XXX BREAKPOINT") && has("python")
161161

162-
Python << EOF
163-
from imp import find_module
164-
165-
for module in ('pudb', 'ipdb'):
166-
try:
167-
find_module(module)
168-
vim.command('let g:pymode_breakpoint_cmd = "import %s; %s.set_trace() # XXX BREAKPOINT"' % (module, module))
169-
except ImportError:
170-
continue
171-
EOF
162+
call pymode#breakpoint#SearchDebuger()
172163

173164
endif
174165

0 commit comments

Comments
 (0)