From d145a6d8d08d7ed03a053c25566369153d1170a7 Mon Sep 17 00:00:00 2001 From: Liam Galvin Date: Sun, 21 Oct 2018 13:30:32 +0100 Subject: [PATCH] remove comments/debug --- buffer/buffer.go | 3 --- buffer/buffer_test.go | 4 ---- glfont/truetype.go | 3 --- gui/gui.go | 11 +---------- 4 files changed, 1 insertion(+), 20 deletions(-) diff --git a/buffer/buffer.go b/buffer/buffer.go index f37d232..29cf4ef 100644 --- a/buffer/buffer.go +++ b/buffer/buffer.go @@ -315,7 +315,6 @@ func (buffer *Buffer) Backspace() { buffer.MovePosition(int16(buffer.Width()-1), -1) } else { //@todo ring bell or whatever - actually i think the pty will trigger this - //fmt.Println("BELL?") } } else { buffer.MovePosition(-1, 0) @@ -334,8 +333,6 @@ func (buffer *Buffer) NewLine() { if (buffer.topMargin > 0 || buffer.bottomMargin < uint(buffer.ViewHeight())-1) && uint(buffer.cursorY) == buffer.bottomMargin { - fmt.Printf("Top %d Bot %d VH %d", buffer.topMargin, buffer.bottomMargin, buffer.ViewHeight()) - // scrollable region is enabled for i := buffer.topMargin; i < buffer.bottomMargin; i++ { above := buffer.getViewLine(uint16(i)) diff --git a/buffer/buffer_test.go b/buffer/buffer_test.go index 4e950b5..9b864e5 100644 --- a/buffer/buffer_test.go +++ b/buffer/buffer_test.go @@ -1,7 +1,6 @@ package buffer import ( - "fmt" "strings" "testing" "time" @@ -21,9 +20,6 @@ func TestOffsets(t *testing.T) { assert.Equal(t, uint16(10), b.ViewWidth()) assert.Equal(t, uint16(10), b.Width()) assert.Equal(t, uint16(3), b.ViewHeight()) - for i, l := range b.lines { - fmt.Printf("%d. %s", i, l.String()) - } assert.Equal(t, 5, b.Height()) } diff --git a/glfont/truetype.go b/glfont/truetype.go index 2ac8749..7809e2c 100644 --- a/glfont/truetype.go +++ b/glfont/truetype.go @@ -1,7 +1,6 @@ package glfont import ( - "fmt" "io" "io/ioutil" @@ -50,8 +49,6 @@ func LoadTrueTypeFont(program uint32, r io.Reader, scale float32) (*Font, error) f.linePadding = h - float32(ttfFace.Metrics().Height>>6) f.lineHeight = h - fmt.Printf("Line height: %f px, padding: %f px", f.lineHeight, f.linePadding) - gl.BindTexture(gl.TEXTURE_2D, 0) // Configure VAO/VBO for texture quads diff --git a/gui/gui.go b/gui/gui.go index aa0cac1..be02f00 100644 --- a/gui/gui.go +++ b/gui/gui.go @@ -32,7 +32,6 @@ type GUI struct { func New(config *config.Config, terminal *terminal.Terminal, logger *zap.SugaredLogger) *GUI { - //logger. return &GUI{ config: config, logger: logger, @@ -48,10 +47,6 @@ func New(config *config.Config, terminal *terminal.Terminal, logger *zap.Sugared // can only be called on OS thread func (gui *GUI) resize(w *glfw.Window, width int, height int) { - if width == gui.width && height == gui.height { - //return - } - gui.logger.Debugf("Initiating GUI resize to %dx%d", width, height) gui.width = width @@ -81,7 +76,6 @@ func (gui *GUI) resize(w *glfw.Window, width int, height int) { } func (gui *GUI) glfwScrollCallback(w *glfw.Window, xoff float64, yoff float64) { - //fmt.Printf("Scroll x=%f y=%f\n", xoff, yoff) if yoff > 0 { gui.terminal.ScrollUp(1) } else { @@ -162,7 +156,6 @@ func (gui *GUI) Render() error { gl.UseProgram(program) // stop smoothing fonts - gl.Disable(gl.DEPTH_TEST) gl.TexParameterf(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST) @@ -174,7 +167,6 @@ func (gui *GUI) Render() error { ) gui.terminal.AttachTitleChangeHandler(titleChan) - //gui.terminal.AttachDisplayChangeHandler(changeChan) ticker := time.NewTicker(time.Second) defer ticker.Stop() @@ -194,13 +186,12 @@ func (gui *GUI) Render() error { case <-titleChan: gui.window.SetTitle(gui.terminal.GetTitle()) default: - //glfw.PollEvents() + // this is more efficient than glfw.PollEvents() glfw.WaitEventsTimeout(0.02) // up to 50fps on no input, otherwise higher } if gui.terminal.CheckDirty() { - //gl.UseProgram(program) gl.Clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT) lines := gui.terminal.GetVisibleLines()