Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of http://github.com/phuihock/pyflakes-vim into…

… quickfix
  • Loading branch information...
commit 80e1680e213d3ca9fde15f41332f1695c51b3a43 2 parents 1dffdbe + eaeb6d1
@kevinw authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 pyflakes.vim
View
15 pyflakes.vim
@@ -174,12 +174,21 @@ if !exists("*s:RunPyflakes")
let b:matched = []
let b:matchedlines = {}
+
+ let b:qf_list = []
python << EOF
for w in check(vim.current.buffer):
vim.command('let s:matchDict = {}')
vim.command("let s:matchDict['lineNum'] = " + str(w.lineno))
vim.command("let s:matchDict['message'] = '%s'" % vim_quote(w.message % w.message_args))
vim.command("let b:matchedlines[" + str(w.lineno) + "] = s:matchDict")
+
+ vim.command("let l:qf_item = {}")
+ vim.command("let l:qf_item.bufnr = bufnr('%')")
+ vim.command("let l:qf_item.filename = expand('%')")
+ vim.command("let l:qf_item.lnum = %s" % str(w.lineno))
+ vim.command("let l:qf_item.text = '%s'" % vim_quote(w.message % w.message_args))
+ vim.command("let l:qf_item.type = 'E'")
if w.col is None or isinstance(w, SyntaxError):
# without column information, just highlight the whole line
@@ -189,7 +198,13 @@ for w in check(vim.current.buffer):
# with a column number, highlight the first keyword there
vim.command(r"let s:mID = matchadd('PyFlakes', '^\%" + str(w.lineno) + r"l\_.\{-}\zs\k\+\k\@!\%>" + str(w.col) + r"c')")
+ vim.command("let l:qf_item.vcol = 1")
+ vim.command("let l:qf_item.col = %s" % str(w.col + 1))
+
vim.command("call add(b:matched, s:matchDict)")
+ vim.command("call add(b:qf_list, l:qf_item)")
+
+vim.command("call setqflist(b:qf_list, 'r')")
EOF
let b:cleared = 0
endfunction
Please sign in to comment.
Something went wrong with that request. Please try again.