Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
Refactor; There is a maximum of 10 error lists in the stack. :colder/…
Browse files Browse the repository at this point in the history
…cnewer 9 is enough.
  • Loading branch information
phuihock committed Jul 10, 2010
1 parent dcf8baa commit 5529f1c
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions pyflakes.vim
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ if !exists("*s:GetQuickFixStackCount")
function s:GetQuickFixStackCount()
let l:stack_count = 0
try
silent colder 99
silent colder 9
catch /E380:/
endtry

try
for i in range(99)
for i in range(9)
silent cnewer
let l:stack_count = l:stack_count + 1
endfor
Expand All @@ -178,6 +178,23 @@ if !exists("*s:GetQuickFixStackCount")
endfunction
endif

if !exists("*s:ActivatePyflakesQuickFixWindow")
function s:ActivatePyflakesQuickFixWindow()
try
silent colder 9 " go to the bottom of quickfix stack
catch /E380:/
endtry

if s:pyflakes_qf > 0
try
exe "silent cnewer " . s:pyflakes_qf
catch /E381:/
echoerr "Could not activate Pyflakes Quickfix Window."
endtry
endif
endfunction
endif

if !exists("*s:RunPyflakes")
function s:RunPyflakes()
highlight link PyFlakes SpellBad
Expand Down Expand Up @@ -227,18 +244,7 @@ for w in check(vim.current.buffer):
EOF
if exists("s:pyflakes_qf")
" if pyflakes quickfix window is already created, reuse it
try
silent colder 99 " go to the bottom of quickfix stack
catch /E380:/
endtry

if s:pyflakes_qf > 0
try
exe "silent cnewer " . s:pyflakes_qf
catch /E381:/
echoerr "Could not activate Pyflakes Quickfix Window."
endtry
endif
call s:ActivatePyflakesQuickFixWindow()
call setqflist(b:qf_list, 'r')
else
" one pyflakes quickfix window for all buffer
Expand Down

0 comments on commit 5529f1c

Please sign in to comment.