func (i *Input) MoveCursorRight() {
	if i.CursorPositionText < len(i.Text) {
		i.CursorPositionText++
		i.ScrollRight()
	}
	i.Par.Text = string(i.Text[i.Offset:])
}
MoveCursorRight will increase the current CursorPositionText with 1
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()
}
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:])
	}
}
func (i *Input) Delete() {
	if i.CursorPositionText < len(i.Text) {
		i.Text = append(i.Text[0:i.CursorPositionText], i.Text[i.CursorPositionText+1:]...)
		i.Par.Text = string(i.Text[i.Offset:])
	}
}