para fix, xroom better
This commit is contained in:
parent
c356322a3c
commit
b7a018793f
|
@ -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])', '<¶>%1'):gsub('<¶>[ \t]*', '\n'..txtnb(para_mod.space));
|
r = r:gsub('\n([^\n])', '<¶>%1'):gsub('<¶>[ \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)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Reference in a new issue