@@ -13,7 +13,7 @@ local instead = std.ref '@instead'
13
13
local iface = txt
14
14
15
15
local function use_text_event (key )
16
- if key == " return" or key == " space " then
16
+ if key == " return" then
17
17
return false
18
18
end
19
19
return instead .text_input and instead .text_input ()
@@ -622,6 +622,7 @@ local dbg = std.obj {
622
622
if # hint == 1 and edit ~= false then
623
623
local _ , par = s .commands :lookup (s .input )
624
624
if par then
625
+ s .input = std .strip (s .input )
625
626
local len = par :len ()
626
627
s .input = s .input :sub (1 , s .input :len () - len )
627
628
end
@@ -670,9 +671,9 @@ local dbg = std.obj {
670
671
if not use_text_event () or not s .on then
671
672
return
672
673
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
676
677
return ' @dbg text ' .. string.format (" %q" , text )
677
678
end ;
678
679
key = function (s , press , key )
@@ -805,19 +806,19 @@ std.mod_cmd(function(cmd)
805
806
dbg .input = ' '
806
807
elseif (key == ' l' and dbg .key_ctrl ) then
807
808
dbg :cls ()
808
- elseif key : find ' ^ right' then
809
+ elseif key == ' right' then
809
810
if dbg .cursor <= dbg .input :len () then
810
811
local i = utf_ff (dbg .input , dbg .cursor )
811
812
dbg .cursor = dbg .cursor + i
812
813
end
813
814
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
815
816
if dbg .cursor > 1 then
816
817
local i = utf_bb (dbg .input , dbg .cursor - 1 )
817
818
dbg .cursor = dbg .cursor - i
818
819
end
819
820
if dbg .cursor < 1 then dbg .cursor = 1 end
820
- elseif key : find ' ^ up' then
821
+ elseif key == ' up' then
821
822
local s = dbg
822
823
if # s .history == 0 then
823
824
return
@@ -831,7 +832,7 @@ std.mod_cmd(function(cmd)
831
832
end
832
833
s .input = s .history [s .history_pos ]
833
834
s .cursor = # s .input + 1
834
- elseif key : find ' ^ down' then
835
+ elseif key == ' down' then
835
836
local s = dbg
836
837
if # s .history == 0 or s .history_pos == # s .history then
837
838
return
0 commit comments