para fix, xroom better

This commit is contained in:
p.kosyh 2010-06-29 16:23:52 +00:00
parent c356322a3c
commit b7a018793f
2 changed files with 7 additions and 12 deletions

View file

@ -6,7 +6,7 @@ stead.fmt = stead.hook(stead.fmt, function(f, ...)
local r = f(unpack(arg))
if type(r) == 'string' and stead.state then
r = r:gsub('\n([^\n])', '<&para;>%1'):gsub('<&para;>[ \t]*', '\n'..txtnb(para_mod.space));
r = r:gsub('^',txtnb(para_mod.space))
r = r:gsub('^[ \t]*',txtnb(para_mod.space))
end
return r;
end)

View file

@ -110,15 +110,10 @@ end
default_xdsc_obj = xdsc();
xroom = stead.hook(room, function(f, v, ...)
if type(v) == 'table' then
if v.obj == nil then
v.obj = {}
elseif type(v.obj) ~= 'table' then
error("Wrong parameter to xroom.", 2);
end
-- we not use put here, to force saver do not save all list
stead.table.insert(v.obj, 1, 'default_xdsc_obj');
end
return f(v, unpack(arg))
xroom = stead.inherit(room, function(v)
v.look = stead.hook(v.look, function(f, s,...)
local xdsc = call(s, 'xdsc');
return par(' ', xdsc, f(s, unpack(arg)));
end)
return v
end)