forked from izaya/OC-PsychOS2
^C now terminates line mode input with an error
This commit is contained in:
parent
ddc2445104
commit
a533748d55
@ -307,6 +307,8 @@ function buffer:read(...)
|
|||||||
if #buffer > 0 and pos <= #buffer then
|
if #buffer > 0 and pos <= #buffer then
|
||||||
buffer = buffer:sub(1, (#buffer - pos)) .. buffer:sub((#buffer - pos) + 2)
|
buffer = buffer:sub(1, (#buffer - pos)) .. buffer:sub((#buffer - pos) + 2)
|
||||||
end
|
end
|
||||||
|
elseif char == "\3" then -- ^C, error
|
||||||
|
error("terminated")
|
||||||
elseif char == "\1" then -- ^A, go to start of line
|
elseif char == "\1" then -- ^A, go to start of line
|
||||||
pos = buffer:len()+1
|
pos = buffer:len()+1
|
||||||
elseif char == "\5" then -- ^E, go to end of line
|
elseif char == "\5" then -- ^E, go to end of line
|
||||||
|
Loading…
Reference in New Issue
Block a user