Skip to content

Commit

Permalink
Emit more helpful initialization error messages in buffer/view settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
orbitalquark committed Aug 1, 2020
1 parent 513894c commit a1f7931
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ for _, mt in ipairs{buffer_mt, view_mt} do
__newindex = function(property, k2, v2)
settings[#settings + 1] = string.format(
'buffer.%s[%s]=%s', k, repr(k2), repr(v2))
property_mt.__newindex(property, k2, v2)
local ok, errmsg = pcall(property_mt.__newindex, property, k2, v2)
if not ok then error(errmsg, 2) end
end
})
end
Expand Down

0 comments on commit a1f7931

Please sign in to comment.