diff --git a/autoload/codi/load.vim b/autoload/codi/load.vim index fff5cc0..c7201f3 100644 --- a/autoload/codi/load.vim +++ b/autoload/codi/load.vim @@ -88,9 +88,9 @@ endfunction " Python rephrasers function! s:rp_py(buf) let b = a:buf - " Insert # in the blank lines above Python's class methods definition to avoid + " Insert # in the blank lines above Python's indention line to avoid " `IndentationError`. - let b = substitute(b, '\(\s*\n\)\+\(\n\s\+def\)\@=', '\=substitute(submatch(0), "\s*\n", "\r#", "g")', 'g') + let b = substitute(b, '\(\s*\n\)\+\(\n\s\+\w\+\)\@=', '\=substitute(submatch(0), "\s*\n", "\r#", "g")', 'g') return b endfunction diff --git a/doc/codi.txt b/doc/codi.txt index 2798bf8..c1d569f 100644 --- a/doc/codi.txt +++ b/doc/codi.txt @@ -394,8 +394,6 @@ notes: python~ bin: python maintainer: @metakirby5 -notes: - - Cannot leave empty lines in defs ruby~ maintainer: @metakirby5 @@ -406,15 +404,7 @@ program; it supports nothing more than what the underlying bin supports. This is why Haskell language pragmas don't work, PureScript only works inside a project folder, and OCaml statements must end with ;;. Also, in most whitespace-sensitive languages, an empty line represents the end of a -definition, so the below Python class will not work in Codi: -> - class Test(object): - def __init__(self): - pass - - def oops_theres_an_empty_line_above_this(self): - return 1 -< +definition. OUTPUT SPECIFICATION *codi-interpreters-output-spec*