Skip to content

Commit c969f5e

Browse files
authored
feat: complete hint text on right arrow (#328)
1 parent 36ce05e commit c969f5e

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# 🎀 Changelog
22

33
## Unreleased
4+
### Added
5+
- Forward/Right arrow key will fill in hint text (#327)
6+
47
### Fixed
58
- Skip over file and prevent panic if info cannot be retrieved during file completion (due to permission error or anything else)
69

readline/hint.go

+7
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,10 @@ func (rl *Instance) resetHintText() {
5656
//rl.hintY = 0
5757
rl.hintText = []rune{}
5858
}
59+
60+
func (rl *Instance) insertHintText() {
61+
if len(rl.hintText) != 0 {
62+
// fill in hint text
63+
rl.insert(rl.hintText)
64+
}
65+
}

readline/readline.go

+3
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,9 @@ func (rl *Instance) escapeSeq(r []rune) {
707707
rl.renderHelpers()
708708
return
709709
}
710+
711+
rl.insertHintText()
712+
710713
if (rl.modeViMode == VimInsert && rl.pos < len(rl.line)) ||
711714
(rl.modeViMode != VimInsert && rl.pos < len(rl.line)-1) {
712715
rl.moveCursorByAdjust(1)

0 commit comments

Comments
 (0)