sammyette 2024-04-11 01:23:43 +00:00 committed by GitHub
commit 22efef531b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -76,6 +76,8 @@ const (
seqCursorTopLeft = "\x1b[H" // Clears screen and places cursor on top-left seqCursorTopLeft = "\x1b[H" // Clears screen and places cursor on top-left
seqGetCursorPos = "\x1b6n" // response: "\x1b{Line};{Column}R" seqGetCursorPos = "\x1b6n" // response: "\x1b{Line};{Column}R"
seqHideCursor = "\x1b[?25l"
seqUnhideCursor = "\x1b[?25h"
seqCtrlLeftArrow = "\x1b[1;5D" seqCtrlLeftArrow = "\x1b[1;5D"
seqCtrlRightArrow = "\x1b[1;5C" seqCtrlRightArrow = "\x1b[1;5C"

View File

@ -10,7 +10,7 @@ import (
// it should coordinate reprinting the input line, any Infos and completions // it should coordinate reprinting the input line, any Infos and completions
// and manage to get back to the current (computed) cursor coordinates // and manage to get back to the current (computed) cursor coordinates
func (rl *Instance) updateHelpers() { func (rl *Instance) updateHelpers() {
print(seqHideCursor)
// Load all Infos & completions before anything. // Load all Infos & completions before anything.
// Thus overwrites anything having been dirtily added/forced/modified, like rl.SetInfoText() // Thus overwrites anything having been dirtily added/forced/modified, like rl.SetInfoText()
rl.getInfoText() rl.getInfoText()
@ -27,6 +27,7 @@ func (rl *Instance) updateHelpers() {
// We are at the prompt line (with the latter // We are at the prompt line (with the latter
// not printed yet), then reprint everything // not printed yet), then reprint everything
rl.renderHelpers() rl.renderHelpers()
print(seqUnhideCursor)
} }
const tabWidth = 4 const tabWidth = 4