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

pull/282/head
Anton Medvedev 8 months ago
parent c2251d223e
commit 7391b11e45
No known key found for this signature in database

@ -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)

Loading…
Cancel
Save