parent
5444ad50c4
commit
204a763dff
1 changed files with 1 additions and 6 deletions
|
@ -204,11 +204,6 @@ func (m *Messenger) Prompt(prompt, historyType string, completionType Completion
|
||||||
}
|
}
|
||||||
|
|
||||||
m.HandleEvent(event, m.history[historyType])
|
m.HandleEvent(event, m.history[historyType])
|
||||||
|
|
||||||
if m.cursorx < 0 {
|
|
||||||
// Cancel
|
|
||||||
m.hasPrompt = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m.Reset()
|
m.Reset()
|
||||||
|
@ -243,8 +238,8 @@ func (m *Messenger) HandleEvent(event tcell.Event, history []string) {
|
||||||
case tcell.KeyBackspace2, tcell.KeyBackspace:
|
case tcell.KeyBackspace2, tcell.KeyBackspace:
|
||||||
if m.cursorx > 0 {
|
if m.cursorx > 0 {
|
||||||
m.response = string([]rune(m.response)[:m.cursorx-1]) + string(m.response[m.cursorx:])
|
m.response = string([]rune(m.response)[:m.cursorx-1]) + string(m.response[m.cursorx:])
|
||||||
|
m.cursorx--
|
||||||
}
|
}
|
||||||
m.cursorx--
|
|
||||||
case tcell.KeyRune:
|
case tcell.KeyRune:
|
||||||
m.response = Insert(m.response, m.cursorx, string(e.Rune()))
|
m.response = Insert(m.response, m.cursorx, string(e.Rune()))
|
||||||
m.cursorx++
|
m.cursorx++
|
||||||
|
|
Loading…
Reference in a new issue