viminput can now be exited with ctrl+q in insert mode

This commit is contained in:
2025-01-14 19:14:18 +02:00
parent 58c6a6d38a
commit 2f1ee548be
2 changed files with 4 additions and 2 deletions

View File

@@ -136,8 +136,9 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
if m.locked {
if key, ok := msg.(tea.KeyMsg); ok {
InNormal := m.vi.Mode() == viminput.NormalMode
if key.String() == "q" && InNormal {
inNormalQ := key.String() == "q" && m.vi.Mode() == viminput.NormalMode
inInsertCtrlQ := key.String() == "ctrl+q" && m.vi.Mode() == viminput.InsertMode
if inNormalQ || inInsertCtrlQ {
m.locked = false
m.Prerender()
return m, nil

View File

@@ -631,6 +631,7 @@ func (m *Model) handleInsertModeKeys(key tea.KeyMsg) {
Paste: false,
})
m.Yank(paste)
return
}
if key.Type == tea.KeyTab || key.Type == tea.KeyShiftTab {