Implement jump to start and end functionality

This commit is contained in:
Sameer Rahmani 2022-11-25 13:37:04 +00:00
parent 49465bb6f1
commit ce8f6e0e82
1 changed files with 9 additions and 0 deletions

View File

@ -181,6 +181,15 @@ func main() {
lowerBound += 1
upperBound += 1
}
} else if ev.Key() == tcell.KeyCtrlE || ev.Key() == tcell.KeyEnd {
upperBound = len(*input)
lowerBound = upperBound - ymax + 2
currentLine = len(*input) - 1
} else if ev.Key() == tcell.KeyCtrlA || ev.Key() == tcell.KeyHome {
upperBound = ymax - 2
lowerBound = 0
currentLine = 0
}
}
}