Permalink
Browse files

Refactor; There is a maximum of 10 error lists in the stack. :colder/…

…cnewer 9 is enough.
  • Loading branch information...
phuihock committed Jul 10, 2010
1 parent dcf8baa commit 5529f1c28dbc47ce1a875e53e6f65410792548ce
Showing with 20 additions and 14 deletions.
  1. +20 −14 pyflakes.vim
View
@@ -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
@@ -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
@@ -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

0 comments on commit 5529f1c

Please sign in to comment.