forked from python-mode/python-mode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbreakpoint.vim
More file actions
30 lines (24 loc) · 789 Bytes
/
breakpoint.vim
File metadata and controls
30 lines (24 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
" Quick set or delete a breakpoints
fun! pymode#breakpoint#Set(lnum) "{{{
let line = getline(a:lnum)
if strridx(line, g:pymode_breakpoint_cmd) != -1
normal dd
else
let plnum = prevnonblank(a:lnum)
call append(line('.')-1, repeat(' ', indent(plnum)).g:pymode_breakpoint_cmd)
normal k
endif
" Save file without any events
if &modifiable && &modified | noautocmd write | endif
endfunction "}}}
fun! pymode#breakpoint#SearchDebuger() "{{{
Python << EOF
from imp import find_module
for module in ('pudb', 'ipdb'):
try:
find_module(module)
vim.command('let g:pymode_breakpoint_cmd = "import %s; %s.set_trace() # XXX BREAKPOINT"' % (module, module))
except ImportError:
continue
EOF
endfunction "}}}