Created
October 31, 2012 08:07
-
-
Save Osse/3985757 to your computer and use it in GitHub Desktop.
Pymode path for PEP8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/autoload/pymode/breakpoint.vim b/autoload/pymode/breakpoint.vim | |
index 7d98327..e98aeba 100644 | |
--- a/autoload/pymode/breakpoint.vim | |
+++ b/autoload/pymode/breakpoint.vim | |
@@ -1,10 +1,12 @@ | |
fun! pymode#breakpoint#Set(lnum) "{{{ | |
let line = getline(a:lnum) | |
- if strridx(line, g:pymode_breakpoint_cmd) != -1 | |
- normal dd | |
+ if strridx(line, g:pymode_breakpoint_cmd[0]) != -1 && | |
+ \ strridx(line+1, g:pymode_breakpoint_cmd[1]) != -1 | |
+ normal 2dd | |
else | |
let plnum = prevnonblank(a:lnum) | |
- call append(line('.')-1, repeat(' ', indent(plnum)).g:pymode_breakpoint_cmd) | |
+ let indent = repeat(' ', indent(plnum)) | |
+ call append(line('.')-1, map(g:pymode_breakpoint_cmd, 'indent.v:val')) | |
normal k | |
endif | |
diff --git a/plugin/pymode.vim b/plugin/pymode.vim | |
index 4c4e580..7dd9d03 100644 | |
--- a/plugin/pymode.vim | |
+++ b/plugin/pymode.vim | |
@@ -151,13 +151,13 @@ endif | |
if !pymode#Default("g:pymode_breakpoint", 1) || g:pymode_breakpoint | |
- if !pymode#Default("g:pymode_breakpoint_cmd", "import ipdb; ipdb.set_trace() ### XXX BREAKPOINT") && has("python") | |
+ if !pymode#Default("g:pymode_breakpoint_cmd", ['import ipdb', 'ipdb.set_trace() ### XXX BREAKPOINT']) && has("python") | |
python << EOF | |
from imp import find_module | |
try: | |
find_module('ipdb') | |
except ImportError: | |
- vim.command('let g:pymode_breakpoint_cmd = "import pdb; pdb.set_trace() ### XXX BREAKPOINT"') | |
+ vim.command('let g:pymode_breakpoint_cmd = ["import pdb", "pdb.set_trace() ### XXX BREAKPOINT"]') | |
EOF | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment