From b11f8ce05a9b46b356cba368723d2e32f71b86ea Mon Sep 17 00:00:00 2001 From: Mateusz Drewniak Date: Sun, 16 Jul 2023 12:23:16 +0200 Subject: [PATCH] Fix accidental name change --- prompt.go | 12 ++++++------ render.go => renderer.go | 4 ++-- render_test.go => renderer_test.go | 0 3 files changed, 8 insertions(+), 8 deletions(-) rename render.go => renderer.go (98%) rename render_test.go => renderer_test.go (100%) diff --git a/prompt.go b/prompt.go index e6ba2961..d1fd59ca 100644 --- a/prompt.go +++ b/prompt.go @@ -74,7 +74,7 @@ func (p *Prompt) Run() { p.completion.Update(*p.buf.Document()) } - p.renderer.Renderer(p.buf, p.completion, p.lexer) + p.renderer.Render(p.buf, p.completion, p.lexer) bufCh := make(chan []byte, 128) stopReadBufCh := make(chan struct{}) @@ -105,7 +105,7 @@ func (p *Prompt) Run() { p.completion.Update(*p.buf.Document()) - p.renderer.Renderer(p.buf, p.completion, p.lexer) + p.renderer.Render(p.buf, p.completion, p.lexer) if p.exitChecker != nil && p.exitChecker(e.input, true) { p.skipClose = true @@ -117,11 +117,11 @@ func (p *Prompt) Run() { go p.handleSignals(exitCh, winSizeCh, stopHandleSignalCh) } else { p.completion.Update(*p.buf.Document()) - p.renderer.Renderer(p.buf, p.completion, p.lexer) + p.renderer.Render(p.buf, p.completion, p.lexer) } case w := <-winSizeCh: p.renderer.UpdateWinSize(w) - p.renderer.Renderer(p.buf, p.completion, p.lexer) + p.renderer.Render(p.buf, p.completion, p.lexer) case code := <-exitCh: p.renderer.BreakLine(p.buf, p.lexer) p.Close() @@ -337,7 +337,7 @@ func (p *Prompt) Input() string { p.completion.Update(*p.buf.Document()) } - p.renderer.Renderer(p.buf, p.completion, p.lexer) + p.renderer.Render(p.buf, p.completion, p.lexer) bufCh := make(chan []byte, 128) stopReadBufCh := make(chan struct{}) go p.readBuffer(bufCh, stopReadBufCh) @@ -355,7 +355,7 @@ func (p *Prompt) Input() string { return e.input } else { p.completion.Update(*p.buf.Document()) - p.renderer.Renderer(p.buf, p.completion, p.lexer) + p.renderer.Render(p.buf, p.completion, p.lexer) } default: time.Sleep(10 * time.Millisecond) diff --git a/render.go b/renderer.go similarity index 98% rename from render.go rename to renderer.go index 14905c05..660764e5 100644 --- a/render.go +++ b/renderer.go @@ -206,8 +206,8 @@ func (r *Renderer) renderCompletion(buf *Buffer, completions *CompletionManager) r.out.SetColor(DefaultColor, DefaultColor, false) } -// Renderer renders to the console. -func (r *Renderer) Renderer(buffer *Buffer, completion *CompletionManager, lexer Lexer) { +// Render renders to the console. +func (r *Renderer) Render(buffer *Buffer, completion *CompletionManager, lexer Lexer) { // In situations where a pseudo tty is allocated (e.g. within a docker container), // window size via TIOCGWINSZ is not immediately available and will result in 0,0 dimensions. if r.col == 0 { diff --git a/render_test.go b/renderer_test.go similarity index 100% rename from render_test.go rename to renderer_test.go