Adding new stuff
This commit is contained in:
parent
131691e143
commit
6c0a9f5b29
718 changed files with 0 additions and 0 deletions
51
vim-plugins/python-mode/autoload/pymode/breakpoint.vim
Normal file
51
vim-plugins/python-mode/autoload/pymode/breakpoint.vim
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
fun! pymode#breakpoint#init() "{{{
|
||||
|
||||
if !g:pymode_breakpoint
|
||||
return
|
||||
endif
|
||||
|
||||
if g:pymode_breakpoint_cmd == ''
|
||||
let g:pymode_breakpoint_cmd = 'import pdb; pdb.set_trace() # XXX BREAKPOINT'
|
||||
|
||||
if g:pymode_python == 'disable'
|
||||
return
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
PymodePython << EOF
|
||||
|
||||
from imp import find_module
|
||||
|
||||
for module in ('wdb', 'pudb', 'ipdb'):
|
||||
try:
|
||||
find_module(module)
|
||||
vim.command('let g:pymode_breakpoint_cmd = "import %s; %s.set_trace() # XXX BREAKPOINT"' % (module, module))
|
||||
break
|
||||
except ImportError:
|
||||
continue
|
||||
|
||||
EOF
|
||||
|
||||
endfunction "}}}
|
||||
|
||||
fun! pymode#breakpoint#operate(lnum) "{{{
|
||||
let line = getline(a:lnum)
|
||||
if strridx(line, g:pymode_breakpoint_cmd) != -1
|
||||
normal dd
|
||||
else
|
||||
let plnum = prevnonblank(a:lnum)
|
||||
if &expandtab
|
||||
let indents = repeat(' ', indent(plnum))
|
||||
else
|
||||
let indents = repeat("\t", plnum / &shiftwidth)
|
||||
endif
|
||||
|
||||
call append(line('.')-1, indents.g:pymode_breakpoint_cmd)
|
||||
normal k
|
||||
endif
|
||||
|
||||
" Save file without any events
|
||||
call pymode#save()
|
||||
|
||||
endfunction "}}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue