func (i *Input) Backspace() {
	if i.CursorPositionText > 0 {
		if i.Offset > 0 {
			i.Offset--
			i.CursorPositionText--
		} else {
			i.MoveCursorLeft()
		}
		i.Text = append(i.Text[0:i.CursorPositionText], i.Text[i.CursorPositionText+1:]...)
		i.Par.Text = string(i.Text[i.Offset:])
	}
}
Backspace will remove a character in front of the CursorPositionText
package components
import (
	"github.com/erroneousboat/termui"
	runewidth "github.com/mattn/go-runewidth"
)
type Input struct {
	Par                  *termui.Par
	Text                 []rune
	CursorPositionScreen int
	CursorPositionText   int
	Offset               int
}
func CreateInputComponent() *Input {
	input := &Input{
		Par:                  termui.NewPar(""),
		Text:                 make([]rune, 0),
		CursorPositionScreen: 0,
		CursorPositionText:   0,
		Offset:               0,
	}
	input.Par.Height = 3
	return input
}
func (i *Input) Buffer() termui.Buffer {
	buf := i.Par.Buffer()
	char := buf.At(i.Par.InnerX()+i.CursorPositionScreen, i.Par.Block.InnerY())
	buf.Set(
		i.Par.InnerX()+i.CursorPositionScreen,
		i.Par.Block.InnerY(),
		termui.Cell{
			Ch: char.Ch,
			Fg: i.Par.TextBgColor,
			Bg: i.Par.TextFgColor,
		},
	)
	return buf
}
func (i *Input) GetHeight() int {
	return i.Par.Block.GetHeight()
}
func (i *Input) SetWidth(w int) {
	i.Par.SetWidth(w)
}
func (i *Input) SetX(x int) {
	i.Par.SetX(x)
}
func (i *Input) SetY(y int) {
	i.Par.SetY(y)
}
func (i *Input) Insert(key rune) {
	left := make([]rune, len(i.Text[0:i.CursorPositionText]))
	copy(left, i.Text[0:i.CursorPositionText])
	left = append(left, key)
	i.Text = append(left, i.Text[i.CursorPositionText:]...)
	i.MoveCursorRight()
}