From a54c66a75143f08aab71b1088e7e23b83d57ef0a Mon Sep 17 00:00:00 2001 From: itchyny Date: Thu, 17 Oct 2024 22:04:28 +0900 Subject: [PATCH] remove unused receiver names --- buffer/const.go | 2 +- layout/layout.go | 8 ++++---- tui/tui_window.go | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/buffer/const.go b/buffer/const.go index dfafb42..7955ec6 100644 --- a/buffer/const.go +++ b/buffer/const.go @@ -11,7 +11,7 @@ func (r constReader) Read(b []byte) (int, error) { } // Seek implements the io.Seeker interface. -func (r constReader) Seek(int64, int) (int64, error) { +func (constReader) Seek(int64, int) (int64, error) { return 0, nil } diff --git a/layout/layout.go b/layout/layout.go index fbfdfe0..1df376c 100644 --- a/layout/layout.go +++ b/layout/layout.go @@ -37,7 +37,7 @@ func NewLayout(index int) Layout { return Window{Index: index, Active: true} } -func (l Window) isLayout() {} +func (Window) isLayout() {} // Collect returns all the Window. func (l Window) Collect() map[int]Window { @@ -125,7 +125,7 @@ func (l Window) SplitRight(index int) Layout { } // Count returns the width and height counts. -func (l Window) Count() (int, int) { +func (Window) Count() (int, int) { return 1, 1 } @@ -177,7 +177,7 @@ type Horizontal struct { height int } -func (l Horizontal) isLayout() {} +func (Horizontal) isLayout() {} // Collect returns all the Window. func (l Horizontal) Collect() map[int]Window { @@ -342,7 +342,7 @@ type Vertical struct { height int } -func (l Vertical) isLayout() {} +func (Vertical) isLayout() {} // Collect returns all the Window. func (l Vertical) Collect() map[int]Window { diff --git a/tui/tui_window.go b/tui/tui_window.go index f764c96..43e22b2 100644 --- a/tui/tui_window.go +++ b/tui/tui_window.go @@ -23,7 +23,7 @@ func (ui *tuiWindow) setCursor(line int, offset int) { ui.screen.ShowCursor(ui.region.left+offset, ui.region.top+line) } -func (ui *tuiWindow) offsetStyleWidth(s *state.WindowState) int { +func offsetStyleWidth(s *state.WindowState) int { threshold := int64(0xfffff) for i := range 10 { if s.Length <= threshold { @@ -38,7 +38,7 @@ func (ui *tuiWindow) drawWindow(s *state.WindowState, active bool) { height, width := ui.region.height-2, s.Width cursorPos := int(s.Cursor - s.Offset) cursorLine := cursorPos / width - offsetStyleWidth := ui.offsetStyleWidth(s) + offsetStyleWidth := offsetStyleWidth(s) eis := s.EditedIndices for 0 < len(eis) && eis[1] <= s.Offset { eis = eis[2:]