diff options
| author | Kyren223 <Kyren223@proton.me> | 2024-12-08 17:19:55 +0200 |
|---|---|---|
| committer | Kyren223 <Kyren223@proton.me> | 2024-12-08 17:19:55 +0200 |
| commit | 8e67541d0914ff126ae96e63e5220dac613b9ace (patch) | |
| tree | 41e330cc068e6f9081c35cf45feac893bdb8c36e /internal/client | |
| parent | 55f4ca9cd9f0c37fbbad9d38a8b6f8a23be33628 (diff) | |
Fixed "I" motion to be inline with nvim (act like _ instead of 0)
Diffstat (limited to 'internal/client')
| -rw-r--r-- | internal/client/ui/viminput/viminput.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/client/ui/viminput/viminput.go b/internal/client/ui/viminput/viminput.go index f45c472..dfd920e 100644 --- a/internal/client/ui/viminput/viminput.go +++ b/internal/client/ui/viminput/viminput.go @@ -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 |
