Skip to content

Commit

Permalink
Clean unused receivers
Browse files Browse the repository at this point in the history
The code is clearer about what is used
  • Loading branch information
ccoVeille committed Apr 5, 2024
1 parent 03c42ee commit 363dfc7
Show file tree
Hide file tree
Showing 21 changed files with 70 additions and 70 deletions.
4 changes: 2 additions & 2 deletions oviewer/draw.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func (root *Root) drawNoWrapLine(y int, startX int, lN int, lc contents) (int, i

// bodyStyle applies the style from the beginning to the end of one line of the body.
// Apply style to contents.
func (root *Root) bodyStyle(lc contents, s OVStyle) {
func (*Root) bodyStyle(lc contents, s OVStyle) {
RangeStyle(lc, 0, len(lc), s)
}

Expand All @@ -314,7 +314,7 @@ func (root *Root) searchHighlight(line LineC) {
}

// plainStyle defaults to the original style.
func (root *Root) plainStyle(lc contents) {
func (*Root) plainStyle(lc contents) {
for x := 0; x < len(lc); x++ {
lc[x].style = tcell.StyleDefault
}
Expand Down
2 changes: 1 addition & 1 deletion oviewer/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ type eventCloseDocument struct {
}

// CloseDocument fires the eventCloseDocument event.
func (root *Root) CloseDocument(m *Document) {
func (root *Root) CloseDocument(_ *Document) {
root.sendCloseDocument()
}

Expand Down
8 changes: 4 additions & 4 deletions oviewer/input_delimiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ func newDelimiterEvent(clist *candidate) *eventDelimiter {
}

// Mode returns InputMode.
func (e *eventDelimiter) Mode() InputMode {
func (*eventDelimiter) Mode() InputMode {
return Delimiter
}

// Prompt returns the prompt string in the input field.
func (e *eventDelimiter) Prompt() string {
func (*eventDelimiter) Prompt() string {
return "Delimiter:"
}

Expand All @@ -59,11 +59,11 @@ func (e *eventDelimiter) Confirm(str string) tcell.Event {
}

// Up returns strings when the up key is pressed during input.
func (e *eventDelimiter) Up(str string) string {
func (e *eventDelimiter) Up(_ string) string {
return e.clist.up()
}

// Down returns strings when the down key is pressed during input.
func (e *eventDelimiter) Down(str string) string {
func (e *eventDelimiter) Down(_ string) string {
return e.clist.down()
}
4 changes: 2 additions & 2 deletions oviewer/input_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ func newSearchFilterEvent(clist *candidate) *eventInputFilter {
}

// Mode returns InputMode.
func (e *eventInputFilter) Mode() InputMode {
func (*eventInputFilter) Mode() InputMode {
return Filter
}

// Prompt returns the prompt string in the input field.
func (e *eventInputFilter) Prompt() string {
func (*eventInputFilter) Prompt() string {
return "&"
}

Expand Down
8 changes: 4 additions & 4 deletions oviewer/input_goto.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ func newGotoEvent(clist *candidate) *eventGoto {
}

// Mode returns InputMode.
func (e *eventGoto) Mode() InputMode {
func (*eventGoto) Mode() InputMode {
return Goline
}

// Prompt returns the prompt string in the input field.
func (e *eventGoto) Prompt() string {
func (*eventGoto) Prompt() string {
return "Goto line:"
}

Expand All @@ -48,11 +48,11 @@ func (e *eventGoto) Confirm(str string) tcell.Event {
}

// Up returns strings when the up key is pressed during input.
func (e *eventGoto) Up(str string) string {
func (e *eventGoto) Up(_ string) string {
return e.clist.up()
}

// Down returns strings when the down key is pressed during input.
func (e *eventGoto) Down(str string) string {
func (e *eventGoto) Down(_ string) string {
return e.clist.down()
}
8 changes: 4 additions & 4 deletions oviewer/input_header.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ func newHeaderEvent() *eventHeader {
}

// Mode returns InputMode.
func (e *eventHeader) Mode() InputMode {
func (*eventHeader) Mode() InputMode {
return Header
}

// Prompt returns the prompt string in the input field.
func (e *eventHeader) Prompt() string {
func (*eventHeader) Prompt() string {
return "Header length:"
}

Expand All @@ -43,7 +43,7 @@ func (e *eventHeader) Confirm(str string) tcell.Event {
}

// Up returns strings when the up key is pressed during input.
func (e *eventHeader) Up(str string) string {
func (*eventHeader) Up(str string) string {
n, err := strconv.Atoi(str)
if err != nil {
return "0"
Expand All @@ -52,7 +52,7 @@ func (e *eventHeader) Up(str string) string {
}

// Down returns strings when the down key is pressed during input.
func (e *eventHeader) Down(str string) string {
func (*eventHeader) Down(str string) string {
n, err := strconv.Atoi(str)
if err != nil || n <= 0 {
return "0"
Expand Down
8 changes: 4 additions & 4 deletions oviewer/input_jumptarget.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ func newJumpTargetEvent(clist *candidate) *eventJumpTarget {
}

// Mode returns InputMode.
func (e *eventJumpTarget) Mode() InputMode {
func (*eventJumpTarget) Mode() InputMode {
return JumpTarget
}

// Prompt returns the prompt string in the input field.
func (e *eventJumpTarget) Prompt() string {
func (*eventJumpTarget) Prompt() string {
return "Jump Target line:"
}

Expand All @@ -55,11 +55,11 @@ func (e *eventJumpTarget) Confirm(str string) tcell.Event {
}

// Up returns strings when the up key is pressed during input.
func (e *eventJumpTarget) Up(str string) string {
func (e *eventJumpTarget) Up(_ string) string {
return e.clist.up()
}

// Down returns strings when the down key is pressed during input.
func (e *eventJumpTarget) Down(str string) string {
func (e *eventJumpTarget) Down(_ string) string {
return e.clist.down()
}
4 changes: 2 additions & 2 deletions oviewer/input_multicolor.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ func newMultiColorEvent(clist *candidate) *eventMultiColor {
}

// Mode returns InputMode.
func (e *eventMultiColor) Mode() InputMode {
func (*eventMultiColor) Mode() InputMode {
return MultiColor
}

// Prompt returns the prompt string in the input field.
func (e *eventMultiColor) Prompt() string {
func (*eventMultiColor) Prompt() string {
return "multicolor:"
}

Expand Down
10 changes: 5 additions & 5 deletions oviewer/input_normal.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@ func normal() *eventNormal {
}

// Mode returns InputMode.
func (e *eventNormal) Mode() InputMode {
func (*eventNormal) Mode() InputMode {
return Normal
}

// Prompt returns the prompt string in the input field.
func (e *eventNormal) Prompt() string {
func (*eventNormal) Prompt() string {
return ""
}

// Confirm returns the event when the input is confirmed.
func (e *eventNormal) Confirm(str string) tcell.Event {
func (*eventNormal) Confirm(_ string) tcell.Event {
return nil
}

// Up returns strings when the up key is pressed during input.
func (e *eventNormal) Up(str string) string {
func (*eventNormal) Up(_ string) string {
return ""
}

// Down returns strings when the down key is pressed during input.
func (e *eventNormal) Down(str string) string {
func (*eventNormal) Down(_ string) string {
return ""
}
8 changes: 4 additions & 4 deletions oviewer/input_savebuffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ func newSaveBufferEvent(clist *candidate) *eventSaveBuffer {
}

// Mode returns InputMode.
func (e *eventSaveBuffer) Mode() InputMode {
func (*eventSaveBuffer) Mode() InputMode {
return SaveBuffer
}

// Prompt returns the prompt string in the input field.
func (e *eventSaveBuffer) Prompt() string {
func (*eventSaveBuffer) Prompt() string {
return "(Save)file:"
}

Expand All @@ -56,11 +56,11 @@ func (e *eventSaveBuffer) Confirm(str string) tcell.Event {
}

// Up returns strings when the up key is pressed during input.
func (e *eventSaveBuffer) Up(str string) string {
func (e *eventSaveBuffer) Up(_ string) string {
return e.clist.up()
}

// Down returns strings when the down key is pressed during input.
func (e *eventSaveBuffer) Down(str string) string {
func (e *eventSaveBuffer) Down(_ string) string {
return e.clist.down()
}
8 changes: 4 additions & 4 deletions oviewer/input_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ func newSearchEvent(clist *candidate) *eventInputSearch {
}

// Mode returns InputMode.
func (e *eventInputSearch) Mode() InputMode {
func (*eventInputSearch) Mode() InputMode {
return Search
}

// Prompt returns the prompt string in the input field.
func (e *eventInputSearch) Prompt() string {
func (*eventInputSearch) Prompt() string {
return "/"
}

Expand Down Expand Up @@ -100,12 +100,12 @@ func newBackSearchEvent(clist *candidate) *eventInputBackSearch {
}

// Mode returns InputMode.
func (e *eventInputBackSearch) Mode() InputMode {
func (*eventInputBackSearch) Mode() InputMode {
return Backsearch
}

// Prompt returns the prompt string in the input field.
func (e *eventInputBackSearch) Prompt() string {
func (*eventInputBackSearch) Prompt() string {
return "?"
}

Expand Down
8 changes: 4 additions & 4 deletions oviewer/input_section_delimiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ func newSectionDelimiterEvent(clist *candidate) *eventSectionDelimiter {
}

// Mode returns InputMode.
func (e *eventSectionDelimiter) Mode() InputMode {
func (*eventSectionDelimiter) Mode() InputMode {
return SectionDelimiter
}

// Prompt returns the prompt string in the input field.
func (e *eventSectionDelimiter) Prompt() string {
func (*eventSectionDelimiter) Prompt() string {
return "Section delimiter:"
}

Expand All @@ -57,11 +57,11 @@ func (e *eventSectionDelimiter) Confirm(str string) tcell.Event {
}

// Up returns strings when the up key is pressed during input.
func (e *eventSectionDelimiter) Up(str string) string {
func (e *eventSectionDelimiter) Up(_ string) string {
return e.clist.up()
}

// Down returns strings when the down key is pressed during input.
func (e *eventSectionDelimiter) Down(str string) string {
func (e *eventSectionDelimiter) Down(_ string) string {
return e.clist.down()
}
8 changes: 4 additions & 4 deletions oviewer/input_section_num.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ func newSectionNumEvent() *eventSectionNum {
}

// Mode returns InputMode.
func (e *eventSectionNum) Mode() InputMode {
func (*eventSectionNum) Mode() InputMode {
return SectionNum
}

// Prompt returns the prompt string in the input field.
func (e *eventSectionNum) Prompt() string {
func (*eventSectionNum) Prompt() string {
return "Section Num:"
}

Expand All @@ -43,7 +43,7 @@ func (e *eventSectionNum) Confirm(str string) tcell.Event {
}

// Up returns strings when the up key is pressed during input.
func (e *eventSectionNum) Up(str string) string {
func (*eventSectionNum) Up(str string) string {
n, err := strconv.Atoi(str)
if err != nil {
return "0"
Expand All @@ -52,7 +52,7 @@ func (e *eventSectionNum) Up(str string) string {
}

// Down returns strings when the down key is pressed during input.
func (e *eventSectionNum) Down(str string) string {
func (*eventSectionNum) Down(str string) string {
n, err := strconv.Atoi(str)
if err != nil || n <= 0 {
return "0"
Expand Down
8 changes: 4 additions & 4 deletions oviewer/input_section_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ func newSectionStartEvent(clist *candidate) *eventSectionStart {
}

// Mode returns InputMode.
func (e *eventSectionStart) Mode() InputMode {
func (*eventSectionStart) Mode() InputMode {
return SectionStart
}

// Prompt returns the prompt string in the input field.
func (e *eventSectionStart) Prompt() string {
func (*eventSectionStart) Prompt() string {
return "Section start:"
}

Expand All @@ -52,11 +52,11 @@ func (e *eventSectionStart) Confirm(str string) tcell.Event {
}

// Up returns strings when the up key is pressed during input.
func (e *eventSectionStart) Up(str string) string {
func (e *eventSectionStart) Up(_ string) string {
return e.clist.up()
}

// Down returns strings when the down key is pressed during input.
func (e *eventSectionStart) Down(str string) string {
func (e *eventSectionStart) Down(_ string) string {
return e.clist.down()
}
8 changes: 4 additions & 4 deletions oviewer/input_skip.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ func newSkipLinesEvent() *eventSkipLines {
}

// Mode returns InputMode.
func (e *eventSkipLines) Mode() InputMode {
func (*eventSkipLines) Mode() InputMode {
return SkipLines
}

// Prompt returns the prompt string in the input field.
func (e *eventSkipLines) Prompt() string {
func (*eventSkipLines) Prompt() string {
return "Skip lines:"
}

Expand All @@ -43,7 +43,7 @@ func (e *eventSkipLines) Confirm(str string) tcell.Event {
}

// Up returns strings when the up key is pressed during input.
func (e *eventSkipLines) Up(str string) string {
func (*eventSkipLines) Up(str string) string {
n, err := strconv.Atoi(str)
if err != nil {
return "0"
Expand All @@ -52,7 +52,7 @@ func (e *eventSkipLines) Up(str string) string {
}

// Down returns strings when the down key is pressed during input.
func (e *eventSkipLines) Down(str string) string {
func (*eventSkipLines) Down(str string) string {
n, err := strconv.Atoi(str)
if err != nil || n <= 0 {
return "0"
Expand Down
Loading

0 comments on commit 363dfc7

Please sign in to comment.