From f9854574b548f804e8777919efe1b635be3dd7f5 Mon Sep 17 00:00:00 2001 From: Lawrence Akka Date: Sat, 14 Sep 2013 19:21:18 +0100 Subject: [PATCH] Fix error line numbers when a range is run --- autoload/pymode/run.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/autoload/pymode/run.vim b/autoload/pymode/run.vim index f33547f0..1ee90627 100644 --- a/autoload/pymode/run.vim +++ b/autoload/pymode/run.vim @@ -113,6 +113,17 @@ EOF let &efm = s:efm cgetexpr(l:traceback) +" If a range is run (starting other than at line 1), fix the reported error line numbers for +" the current buffer + if a:line1 > 1 + let qflist = getqflist() + for i in qflist + if i.bufnr == bufnr("") + let i.lnum = i.lnum - 1 + a:line1 + endif + endfor + call setqflist(qflist) + endif call pymode#QuickfixOpen(0, g:pymode_lint_hold, g:pymode_lint_maxheight, g:pymode_lint_minheight, 0) let &efm = l:_efm