diff --git a/internal/editor/model.go b/internal/editor/model.go index 71995e7..1485869 100644 --- a/internal/editor/model.go +++ b/internal/editor/model.go @@ -334,146 +334,3 @@ func (m *Model) UpdateDefaultRegister(t core.RegisterType, cnt []string) { m.SetRegister('0', t, cnt) m.SetRegister('"', t, cnt) } - -// ================================================== -// Depreciated -// ================================================== -// func (m *Model) Lines() []string { -// win := m.ActiveWindow() -// return win.Buffer.Lines -// } -// -// func (m *Model) Line(idx int) string { -// win := m.ActiveWindow() -// return win.Buffer.Line(idx) -// } -// -// func (m *Model) SetLine(idx int, content string) { -// win := m.ActiveWindow() -// win.Buffer.SetLine(idx, content) -// } -// -// func (m *Model) InsertLine(idx int, content string) { -// win := m.ActiveWindow() -// win.Buffer.InsertLine(idx, content) -// } -// -// func (m *Model) DeleteLine(idx int) { -// win := m.ActiveWindow() -// win.Buffer.DeleteLine(idx) -// } -// -// func (m *Model) LineCount() int { -// win := m.ActiveWindow() -// return win.Buffer.LineCount() -// } -// -// func (m *Model) CursorX() int { -// win := m.ActiveWindow() -// return win.Cursor.Col -// } -// -// func (m *Model) CursorY() int { -// win := m.ActiveWindow() -// return win.Cursor.Line -// } -// -// func (m *Model) SetCursorX(x int) { -// win := m.ActiveWindow() -// win.Cursor.Col = x -// } -// -// func (m *Model) SetCursorY(y int) { -// win := m.ActiveWindow() -// win.Cursor.Line = y -// } -// -// // Anchor methods -// func (m *Model) AnchorX() int { -// win := m.ActiveWindow() -// return win.Anchor.Col -// } -// -// func (m *Model) AnchorY() int { -// win := m.ActiveWindow() -// return win.Anchor.Line -// } -// -// func (m *Model) SetAnchorX(x int) { -// win := m.ActiveWindow() -// win.Anchor.Col = x -// } -// -// func (m *Model) SetAnchorY(y int) { -// win := m.ActiveWindow() -// win.Anchor.Line = y -// } -// -// func (m *Model) GetCursorPosition() *action.Position { -// // Return a copy of the position -// win := m.ActiveWindow() -// pos := win.Cursor -// return &pos -// } -// -// // Window -// func (m *Model) ScrollY() int { -// win := m.ActiveWindow() -// return win.ScrollY -// } -// -// func (m *Model) SetScrollY(y int) { -// win := m.ActiveWindow() -// win.ScrollY = y -// } -// -// func (m *Model) WinH() int { -// win := m.ActiveWindow() -// return win.Height -// } -// -// func (m *Model) WinW() int { -// win := m.ActiveWindow() -// return win.Width -// } -// -// func (m *Model) ViewPortH() int { -// win := m.ActiveWindow() -// return win.Height - 2 -// } -// -// func (m *Model) ClampCursorX() { -// win := m.ActiveWindow() -// win.ClampCursorX() -// } -// -// func (m *Model) ActiveWindowId() int { -// return m.activeWindowId -// } -// -// // TODO: MOVE THIS -// // AdjustScroll ensures the cursor stays within the viewport with scrollOff margins. -// // Call this after any cursor movement. -// func (m *Model) AdjustScroll() { -// viewportHeight := m.ViewPortH() -// if viewportHeight <= 0 { -// return -// } -// -// // Effective scrollOff (can't be more than half the viewport) -// off := min(m.Settings().ScrollOff, viewportHeight/2) -// -// // Cursor too close to top — scroll up -// if m.CursorY() < m.ScrollY()+off { -// m.SetScrollY(m.CursorY() - off) -// } -// -// // Cursor too close to bottom — scroll down -// if m.CursorY() > m.ScrollY()+viewportHeight-1-off { -// m.SetScrollY(m.CursorY() - viewportHeight + 1 + off) -// } -// -// // Clamp scrollY to valid range -// maxScroll := max(0, m.LineCount()-viewportHeight) -// m.SetScrollY(max(0, min(m.ScrollY(), maxScroll))) -// } diff --git a/internal/editor/view.go b/internal/editor/view.go index 92871aa..063d2da 100644 --- a/internal/editor/view.go +++ b/internal/editor/view.go @@ -26,14 +26,7 @@ func (m Model) View() string { // Command bar is seperate cmdBar := drawCommandBar(m) - return view + cmdBar - - // view.WriteString(drawStatusBar(m)) - // view.WriteString("\n") - // view.WriteString(drawCommandBar(m)) - // - // return view.String() } // viewWindow: Renders a single window's content including line numbers and buffer text.