diff options
author | mitchell <70453897+667e-11@users.noreply.github.com> | 2020-08-01 09:21:40 -0400 |
---|---|---|
committer | mitchell <70453897+667e-11@users.noreply.github.com> | 2020-08-01 09:21:40 -0400 |
commit | e5e7d222d11a219f46574f567663e1eb3cbf7750 (patch) | |
tree | 33137e297b526476aab8c356506d70565fcf69ee /init.lua | |
parent | 063b8ff9beeb6a250b12cc3c72673854666b294b (diff) |
Emit more helpful initialization error messages in buffer/view settings.
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 |