fmt fix
This commit is contained in:
parent
3c3c91003c
commit
7f28b2de54
|
@ -159,3 +159,16 @@ function isMenu(v)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
stead.fmt = function(...)
|
||||||
|
local i, res
|
||||||
|
if arg == nil then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
for i=1,stead.table.maxn(arg) do
|
||||||
|
if type(arg[i]) == 'string' then
|
||||||
|
local s = stead.string.gsub(arg[i],'\t',' '):gsub('[\n]+', ' '):gsub('%^','\n');
|
||||||
|
res = par('', res, s);
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return res
|
||||||
|
end
|
||||||
|
|
|
@ -259,8 +259,11 @@ function(f, ...)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
function input_esc(s)
|
function input_esc(s)
|
||||||
|
local rep = function(s)
|
||||||
|
return txtnb(s)
|
||||||
|
end
|
||||||
if not s then return end
|
if not s then return end
|
||||||
return s:gsub("\\","\\\\"):gsub(">","\\>");
|
return s:gsub("\\","\\\\"):gsub(">","\\>"):gsub("[^ ]+", rep):gsub("[ \t]", rep);
|
||||||
end
|
end
|
||||||
|
|
||||||
function inp(info, txt)
|
function inp(info, txt)
|
||||||
|
@ -270,9 +273,9 @@ function inp(info, txt)
|
||||||
end
|
end
|
||||||
v.dsc = function(s)
|
v.dsc = function(s)
|
||||||
if s._edit then
|
if s._edit then
|
||||||
return s.info..txtnb(input_esc(input._txt))..input.cursor
|
return s.info..input_esc(input._txt)..input.cursor
|
||||||
end
|
end
|
||||||
return s.info..txtnb(input_esc(s._txt))
|
return s.info..input_esc(s._txt)
|
||||||
end
|
end
|
||||||
v.text = function(s)
|
v.text = function(s)
|
||||||
if s._edit then return input._txt end
|
if s._edit then return input._txt end
|
||||||
|
|
|
@ -189,7 +189,7 @@ function txtnm(n, v)
|
||||||
return iface:enum(n, v);
|
return iface:enum(n, v);
|
||||||
end
|
end
|
||||||
|
|
||||||
function fmt(...)
|
stead.fmt = function(...)
|
||||||
local i, res
|
local i, res
|
||||||
if arg == nil then
|
if arg == nil then
|
||||||
return false
|
return false
|
||||||
|
@ -1661,7 +1661,7 @@ iface = {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
vv = fmt(cat(par("^^", l, r, av, objs, pv), '^'));
|
vv = stead.fmt(cat(par("^^", l, r, av, objs, pv), '^'));
|
||||||
return vv
|
return vv
|
||||||
end,
|
end,
|
||||||
cmd = function(self, inp)
|
cmd = function(self, inp)
|
||||||
|
|
Reference in a new issue