Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bug fix: Strip newlines from warnings

The communication between `luainspect.vim' and `luainspect4vim.lua' for
the `highlight' action assumes that warning messages never span multiple
lines, but LuaInspect sometimes does include newlines in warnings. This
broke the separation between warning messages and highlight positions
which meant `luainspect.vim' would print "Invalid output" messages.
  • Loading branch information...
commit 59ba90c6c496dfe929cb83b896fe4e594d06354a 1 parent f0eeca2
@xolox authored
Showing with 7 additions and 4 deletions.
  1. +2 −2 luainspect.vim
  2. +5 −2 luainspect4vim.lua
View
4 luainspect.vim
@@ -1,8 +1,8 @@
" Vim plug-in
" Author: Peter Odding <peter@peterodding.com>
-" Last Change: August 15, 2010
+" Last Change: August 16, 2010
" URL: http://peterodding.com/code/vim/lua-inspect/
-" Version: 0.4
+" Version: 0.4.1
" License: MIT
" Support for automatic update using the GLVS plug-in.
View
7 luainspect4vim.lua
@@ -3,7 +3,7 @@
This module is part of the luainspect.vim plug-in for the Vim text editor.
Author: Peter Odding <peter@peterodding.com>
- Last Change: August 15, 2010
+ Last Change: August 16, 2010
URL: http://peterodding.com/code/vim/lua-inspect/
License: MIT
@@ -53,7 +53,10 @@ function actions.highlight(tokenlist, line, column, src) -- {{{1
-- FIXME Why does this report argument count warnings in luainspect/init.lua but not in example.lua?!
local warnings = LI.list_warnings(tokenlist, src)
myprint(#warnings)
- for i, warning in ipairs(warnings) do myprint(warning) end
+ for i, warning in ipairs(warnings) do
+ warning = warning:gsub('%s+', ' ')
+ myprint(warning)
+ end
local curvar = getcurvar(tokenlist, line, column)
for i, token in ipairs(tokenlist) do
if curvar and curvar.ast.id == token.ast.id then
Please sign in to comment.
Something went wrong with that request. Please try again.