Replace gid input with current path only if cursor at the end

This commit is contained in:
Anton Medvedev 2023-09-25 21:56:32 +02:00
parent c2251d223e
commit 7391b11e45
No known key found for this signature in database

View File

@ -291,8 +291,10 @@ func (m *model) handleDigKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
default:
if key.Matches(msg, key.NewBinding(key.WithKeys("."))) {
m.digInput.SetValue(m.cursorPath())
m.digInput.CursorEnd()
if m.digInput.Position() == len(m.digInput.Value()) {
m.digInput.SetValue(m.cursorPath())
m.digInput.CursorEnd()
}
}
m.digInput, cmd = m.digInput.Update(msg)