Skip to content

Commit 8bd219a

Browse files
Обновлена библиотека stead3
1 parent 553214b commit 8bd219a

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

build/stead/stead3/dbg.lua

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ local instead = std.ref '@instead'
1313
local iface = txt
1414

1515
local function use_text_event(key)
16-
if key == "return" or key == "space" then
16+
if key == "return" then
1717
return false
1818
end
1919
return instead.text_input and instead.text_input()
@@ -622,6 +622,7 @@ local dbg = std.obj {
622622
if #hint == 1 and edit ~= false then
623623
local _, par = s.commands:lookup(s.input)
624624
if par then
625+
s.input = std.strip(s.input)
625626
local len = par:len()
626627
s.input = s.input:sub(1, s.input:len() - len)
627628
end
@@ -670,9 +671,9 @@ local dbg = std.obj {
670671
if not use_text_event() or not s.on then
671672
return
672673
end
673-
if text == " " then -- key will handle this
674-
return
675-
end
674+
-- if text == " " then -- key will handle this
675+
-- return
676+
-- end
676677
return '@dbg text '..string.format("%q", text)
677678
end;
678679
key = function(s, press, key)
@@ -805,19 +806,19 @@ std.mod_cmd(function(cmd)
805806
dbg.input = ''
806807
elseif (key == 'l' and dbg.key_ctrl) then
807808
dbg:cls()
808-
elseif key:find '^right' then
809+
elseif key == 'right' then
809810
if dbg.cursor <= dbg.input:len() then
810811
local i = utf_ff(dbg.input, dbg.cursor)
811812
dbg.cursor = dbg.cursor + i
812813
end
813814
if dbg.cursor > dbg.input:len() then dbg.cursor = dbg.input:len() + 1 end
814-
elseif key:find '^left' then
815+
elseif key == 'left' then
815816
if dbg.cursor > 1 then
816817
local i = utf_bb(dbg.input, dbg.cursor - 1)
817818
dbg.cursor = dbg.cursor - i
818819
end
819820
if dbg.cursor < 1 then dbg.cursor = 1 end
820-
elseif key:find '^up' then
821+
elseif key == 'up' then
821822
local s = dbg
822823
if #s.history == 0 then
823824
return
@@ -831,7 +832,7 @@ std.mod_cmd(function(cmd)
831832
end
832833
s.input = s.history[s.history_pos]
833834
s.cursor = #s.input + 1
834-
elseif key:find '^down' then
835+
elseif key == 'down' then
835836
local s = dbg
836837
if #s.history == 0 or s.history_pos == #s.history then
837838
return

0 commit comments

Comments
 (0)