feat: complete hint text on right arrow (#328)

master
sammyette 2024-12-22 08:09:57 -08:00 committed by GitHub
parent 36ce05e85a
commit c969f5ed15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 0 deletions

View File

@ -1,6 +1,9 @@
# 🎀 Changelog
## Unreleased
### Added
- Forward/Right arrow key will fill in hint text (#327)
### Fixed
- Skip over file and prevent panic if info cannot be retrieved during file completion (due to permission error or anything else)

View File

@ -56,3 +56,10 @@ func (rl *Instance) resetHintText() {
//rl.hintY = 0
rl.hintText = []rune{}
}
func (rl *Instance) insertHintText() {
if len(rl.hintText) != 0 {
// fill in hint text
rl.insert(rl.hintText)
}
}

View File

@ -707,6 +707,9 @@ func (rl *Instance) escapeSeq(r []rune) {
rl.renderHelpers()
return
}
rl.insertHintText()
if (rl.modeViMode == VimInsert && rl.pos < len(rl.line)) ||
(rl.modeViMode != VimInsert && rl.pos < len(rl.line)-1) {
rl.moveCursorByAdjust(1)