mirror of https://github.com/liamg/aminal.git
fix tabs
This commit is contained in:
parent
19cbba9936
commit
25802bc97a
|
@ -644,7 +644,7 @@ func (buffer *Buffer) CarriageReturn() {
|
|||
func (buffer *Buffer) Tab() {
|
||||
defer buffer.emitDisplayChange()
|
||||
tabSize := 4
|
||||
shift := int(buffer.cursorX) % tabSize
|
||||
shift := int(buffer.cursorX-1) % tabSize
|
||||
if shift == 0 {
|
||||
shift = tabSize
|
||||
}
|
||||
|
|
|
@ -26,11 +26,15 @@ var escapeSequenceMap = map[rune]escapeSequenceHandler{
|
|||
}
|
||||
|
||||
func newLineSequenceHandler(pty chan rune, terminal *Terminal) error {
|
||||
terminal.logger.Debugf("New line!")
|
||||
terminal.ActiveBuffer().NewLine()
|
||||
return nil
|
||||
}
|
||||
|
||||
func tabSequenceHandler(pty chan rune, terminal *Terminal) error {
|
||||
terminal.ActiveBuffer().Tab()
|
||||
return nil
|
||||
}
|
||||
|
||||
func carriageReturnSequenceHandler(pty chan rune, terminal *Terminal) error {
|
||||
terminal.ActiveBuffer().CarriageReturn()
|
||||
return nil
|
||||
|
@ -61,11 +65,6 @@ func shiftInSequenceHandler(pty chan rune, terminal *Terminal) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func tabSequenceHandler(pty chan rune, terminal *Terminal) error {
|
||||
terminal.logger.Errorf("Received tab")
|
||||
return nil
|
||||
}
|
||||
|
||||
func (terminal *Terminal) processInput(ctx context.Context, pty chan rune) {
|
||||
|
||||
// https://en.wikipedia.org/wiki/ANSI_escape_code
|
||||
|
|
Loading…
Reference in New Issue