remove comments/debug

This commit is contained in:
Liam Galvin 2018-10-21 13:30:32 +01:00
parent 18c6a1a9c8
commit d145a6d8d0
4 changed files with 1 additions and 20 deletions

View File

@ -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))

View File

@ -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())
}

View File

@ -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

View File

@ -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()