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)) local r = f(unpack(arg))
if type(r) == 'string' and stead.state then 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('\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 end
return r; return r;
end) end)

View file

@ -110,15 +110,10 @@ end
default_xdsc_obj = xdsc(); default_xdsc_obj = xdsc();
xroom = stead.hook(room, function(f, v, ...) xroom = stead.inherit(room, function(v)
if type(v) == 'table' then v.look = stead.hook(v.look, function(f, s,...)
if v.obj == nil then local xdsc = call(s, 'xdsc');
v.obj = {} return par(' ', xdsc, f(s, unpack(arg)));
elseif type(v.obj) ~= 'table' then end)
error("Wrong parameter to xroom.", 2); return v
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))
end) end)