Fixed "I" motion to be inline with nvim (act like _ instead of 0)

This commit is contained in:
2024-12-08 17:19:55 +02:00
parent 55f4ca9cd9
commit 8e67541d09

View File

@@ -8,6 +8,7 @@ import (
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"github.com/kyren223/eko/internal/client/ui/colors"
"github.com/kyren223/eko/pkg/assert"
)
var DefaultCursorStyle = lipgloss.NewStyle().Background(colors.White).Foreground(colors.Background)
@@ -212,7 +213,9 @@ func (m *Model) handleNormalModeKeys(key tea.KeyMsg) tea.Cmd {
m.mode = InsertMode
m.SetCursorColumn(m.cursorColumn + 1)
case "I":
m.SetCursorColumn(0)
_, col := m.Motion("_")
assert.Assert(col != -1, "Motion should exist", "motion", "_")
m.SetCursorColumn(col)
m.mode = InsertMode
case "A":
m.mode = InsertMode