Skip to content

Commit

Permalink
when finding python objects don't count comments (fixes issue #18)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredodeza committed Feb 20, 2014
1 parent ba11ec3 commit e92e0c6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ftplugin/python/pytest.vim
Expand Up @@ -271,8 +271,9 @@ function! s:FindPythonObject(obj)
"
" Very naive, but if the indent is less than or equal to four
" keep on going because we assume you are nesting.
" Do not count lines that are comments though.
"
if indent(line('.')) <= 4
if (indent(line('.')) <= 4) && !(getline(line('.')) =~ '\v^\s*#(.*)')
return 1
endif
endwhile
Expand Down Expand Up @@ -332,7 +333,7 @@ function! s:ProjectPath()
let path = fnamemodify(projecttestdir, ':p:h')
elseif(len(projecttestfile) != 0)
let path = fnamemodify(projecttestfile, ':p')
else
else
let path = ''
endif

Expand Down Expand Up @@ -1005,7 +1006,7 @@ function! s:Proxy(action, ...)
call s:ThisFile(verbose, pdb, delgado)
endif
elseif (a:action == "project" )
if looponfail ==1
if looponfail ==1
call s:LoopOnFail(a:action)
call s:ThisProject(verbose, pdb, delgado)
else
Expand Down

0 comments on commit e92e0c6

Please sign in to comment.