Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions autoload/pymode.vim
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,13 @@ fun! pymode#buffer_pre_write() "{{{
endfunction

fun! pymode#buffer_post_write() "{{{
if g:pymode_rope
if b:pymode_modified && g:pymode_rope_regenerate_on_write
call pymode#debug('regenerate')
call pymode#rope#regenerate()
endif
if b:pymode_modified && g:pymode_rope_regenerate_on_write
call pymode#debug('regenerate')
call pymode#rope#regenerate()
endif
if g:pymode_lint
if g:pymode_lint_unmodified || (g:pymode_lint_on_write && b:pymode_modified)
call pymode#debug('check code')
call pymode#lint#check()
endif
if g:pymode_lint_unmodified || (g:pymode_lint_on_write && b:pymode_modified)
call pymode#debug('check code')
call pymode#lint#check()
endif
endfunction "}}}

Expand Down
3 changes: 2 additions & 1 deletion autoload/pymode/lint.vim
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ fun! pymode#lint#check() "{{{
call g:PymodeSigns.refresh(loclist)

if g:pymode_lint_cwindow
call loclist.show()
call setqflist(loclist._loclist)
call pymode#quickfix_open(0, g:pymode_quickfix_maxheight, g:pymode_quickfix_minheight, 0)
endif

call pymode#lint#show_errormessage()
Expand Down
8 changes: 5 additions & 3 deletions autoload/pymode/rope.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"
PymodePython from pymode import rope

call pymode#tools#loclist#init()


fun! pymode#rope#completions(findstart, base)
PymodePython rope.completions()
Expand Down Expand Up @@ -57,7 +55,11 @@ fun! pymode#rope#find_it()
let loclist._title = "Occurrences"
call pymode#wide_message('Finding Occurrences ...')
PymodePython rope.find_it()
call loclist.show()
call pymode#wide_message('')
if !empty(l:output)
call setqflist(l:output)
call pymode#quickfix_open(0, g:pymode_quickfix_maxheight, g:pymode_quickfix_minheight, 0)
end
endfunction


Expand Down
8 changes: 1 addition & 7 deletions autoload/pymode/run.vim
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ let s:efm .= '%-G%.%#'

PymodePython from pymode.run import run_code

call pymode#tools#loclist#init()


" DESC: Run python code
fun! pymode#run#code_run(line1, line2) "{{{
Expand Down Expand Up @@ -88,11 +86,7 @@ fun! pymode#run#code_run(line1, line2) "{{{
call setqflist(qflist)
endif

let loclist = g:PymodeLocList.current()
let loclist._loclist = getqflist()
let loclist._title = "Run errors"
call loclist.show()

call pymode#quickfix_open(0, g:pymode_quickfix_maxheight, g:pymode_quickfix_maxheight, 0)
let &efm = l:_efm

catch /E234/
Expand Down
21 changes: 2 additions & 19 deletions autoload/pymode/tools/loclist.vim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ fun! g:PymodeLocList.init(raw_list) "{{{
let obj = copy(self)
let loc_list = filter(copy(a:raw_list), 'v:val["valid"] == 1')
call obj.clear()
let obj._title = 'CodeCheck'
return obj
endfunction "}}}

Expand All @@ -19,6 +18,7 @@ fun! g:PymodeLocList.current() "{{{
if !exists("b:pymode_loclist")
let b:pymode_loclist = g:PymodeLocList.init([])
endif
let b:pymode_loclist._bufnr = bufnr('.')
return b:pymode_loclist
endfunction "}}}

Expand All @@ -31,7 +31,7 @@ endfunction "}}}
fun! g:PymodeLocList.clear() "{{{
let self._loclist = []
let self._messages = {}
let self._name = expand('%:t')
let self._bufnr = bufnr('')
endfunction "}}}


Expand Down Expand Up @@ -62,20 +62,3 @@ fun! g:PymodeLocList.filter(filters) "{{{
endfor
return loclist
endfunction "}}}


fun! g:PymodeLocList.show() "{{{
call setloclist(0, self._loclist)
if self.is_empty()
lclose
else
let num = winnr()
lopen
setl nowrap
execute max([min([line("$"), g:pymode_quickfix_maxheight]), g:pymode_quickfix_minheight]) . "wincmd _"
if num != winnr()
call setwinvar(winnr(), 'quickfix_title', self._title . ' <' . self._name . '>')
exe num . "wincmd w"
endif
end
endfunction "}}}