From 15d847e3c88413168e6618c038fd15a988cdd088 Mon Sep 17 00:00:00 2001 From: Hayden Hargreaves Date: Fri, 6 Mar 2026 18:20:19 -0700 Subject: [PATCH] chore: removed some todos --- FEATURES.md | 2 +- internal/action/command.go | 1 - internal/core/window.go | 6 +----- internal/editor/helpers_test.go | 1 + internal/editor/model.go | 2 +- 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/FEATURES.md b/FEATURES.md index 736cd7d..c73b7ce 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -264,7 +264,7 @@ Buffers are in-memory representations of files. A buffer exists for each open file. ### Buffer Model -- [ ] Buffer struct (id, filename, lines, modified flag, cursor position) +- [x] Buffer struct (id, filename, lines, modified flag, cursor position) - [ ] Buffer list/manager - [ ] Current buffer tracking - [ ] Buffer-local settings (tabstop, filetype, etc.) diff --git a/internal/action/command.go b/internal/action/command.go index 2d530ee..e8e5ab3 100644 --- a/internal/action/command.go +++ b/internal/action/command.go @@ -137,7 +137,6 @@ func (a CommandExecute) Execute(m Model) tea.Cmd { cmd, err := a.Registry.Execute(m, cmdLine) if err != nil { - // TODO: Display error message to user m.SetCommandError(err) return nil } diff --git a/internal/core/window.go b/internal/core/window.go index a062f1e..4fe1bbe 100644 --- a/internal/core/window.go +++ b/internal/core/window.go @@ -1,6 +1,5 @@ package core -// TODO: No more global settings, window-wide settings type WinOptions struct { Number bool RelativeNumber bool @@ -44,10 +43,7 @@ type Window struct { // of the content or attempt to be "above" the content (negative value). func (w *Window) clampCursor() { // Clamp line to valid range [0, lineCount-1] - maxLine := w.Buffer.LineCount() - 1 - if maxLine < 0 { - maxLine = 0 // Empty buffer edge case - } + maxLine := max(w.Buffer.LineCount()-1, 0) if w.Cursor.Line < 0 { w.Cursor.Line = 0 } else if w.Cursor.Line > maxLine { diff --git a/internal/editor/helpers_test.go b/internal/editor/helpers_test.go index 19f642d..e372d5a 100644 --- a/internal/editor/helpers_test.go +++ b/internal/editor/helpers_test.go @@ -10,6 +10,7 @@ import ( ) // NOTE: Lots of this actually sucks ass, but it works for now... +// TODO: Refactor this to implement the builder pattern // sendKeys sends a sequence of keys to the test model func sendKeys(tm *teatest.TestModel, keys ...string) { diff --git a/internal/editor/model.go b/internal/editor/model.go index 1760817..81f2b5f 100644 --- a/internal/editor/model.go +++ b/internal/editor/model.go @@ -41,7 +41,7 @@ type Model struct { commandError error commandOutput string - // Global settings (TODO: This needs to be refactored) + // Global settings settings core.EditorSettings // Registers