Corrections shell/console/atom

This commit is contained in:
Benjamin VAUDOUR 2024-02-21 10:12:23 +01:00
parent 46731e79d8
commit 2177ea9449
1 changed files with 9 additions and 13 deletions

View File

@ -56,11 +56,8 @@ func (in *input) restart() {
n := in.readRune() n := in.readRune()
next <- n next <- n
needClose := !n.IsOk() r, ok := n.Ok()
if !needClose { needClose := !ok || r == Lf || r == Cr || r == C_C || r == C_D
r, ok := n.Ok()
needClose = ok && (r == Lf || r == Cr || r == C_C || r == C_D)
}
if needClose { if needClose {
close(next) close(next)
@ -317,22 +314,21 @@ func (in *input) nextChar() (key nkey) {
return return
} }
var s Sequence
switch r { switch r {
case Bs: case Bs:
s = A_Bs key = nk(keyS(A_Bs))
case 'O': case 'O':
return in.escO() key = in.escO()
case '[': case '[':
return in.escBracket() key = in.escBracket()
case 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', case 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z': 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z':
s = Sequence(r << 16) key = nk(keyS(Sequence(r << 16)))
default: //default:
return // return
} }
in.clear() in.clear()
return nk(keyS(s)) return
} }