mirror of https://github.com/liamg/aminal.git
Fix merge issues in develop (#257)
* Fix merge issues in develop * Add -timeout to go test The tests are timing out on TravisCI for some reason so a timeout has been added so that `go test` will dump out the goroutine stack traces when the tests are stuck. * gui.Close now wakes up main loop Without this, otherwise successful tests in main_test.go hang. * Use a longer timeout in case CI infrastructure is slow * Fix various gofmt issues Not sure how some of these crept in.
This commit is contained in:
parent
8f183ba440
commit
44233f384e
2
Makefile
2
Makefile
|
@ -13,7 +13,7 @@ build:
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test:
|
||||||
go test -v ./...
|
go test -v -timeout=8m ./...
|
||||||
go vet -v
|
go vet -v
|
||||||
|
|
||||||
.PHONY: check-gofmt
|
.PHONY: check-gofmt
|
||||||
|
|
|
@ -874,7 +874,7 @@ func (buffer *Buffer) Clear() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (buffer *Buffer) ReallyClear() {
|
func (buffer *Buffer) ReallyClear() {
|
||||||
defer buffer.emitDisplayChange()
|
defer buffer.dirty.Notify()
|
||||||
buffer.lines = []Line{}
|
buffer.lines = []Line{}
|
||||||
buffer.terminalState.SetScrollOffset(0)
|
buffer.terminalState.SetScrollOffset(0)
|
||||||
buffer.SetPosition(0, 0)
|
buffer.SetPosition(0, 0)
|
||||||
|
|
|
@ -326,6 +326,7 @@ func (gui *GUI) getTermSize() (uint, uint) {
|
||||||
|
|
||||||
func (gui *GUI) Close() {
|
func (gui *GUI) Close() {
|
||||||
gui.window.SetShouldClose(true)
|
gui.window.SetShouldClose(true)
|
||||||
|
glfw.PostEmptyEvent() // wake up main loop so it notices close request
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gui *GUI) Render() error {
|
func (gui *GUI) Render() error {
|
||||||
|
@ -436,7 +437,7 @@ func (gui *GUI) Render() error {
|
||||||
go gui.waker(stop)
|
go gui.waker(stop)
|
||||||
|
|
||||||
for !gui.window.ShouldClose() {
|
for !gui.window.ShouldClose() {
|
||||||
gui.redraw()
|
gui.redraw(true)
|
||||||
|
|
||||||
if gui.showDebugInfo {
|
if gui.showDebugInfo {
|
||||||
gui.textbox(2, 2, fmt.Sprintf(`Cursor: %d,%d
|
gui.textbox(2, 2, fmt.Sprintf(`Cursor: %d,%d
|
||||||
|
|
|
@ -52,7 +52,7 @@ func (gui *GUI) updateSelectionMode(mods glfw.ModifierKey) {
|
||||||
}
|
}
|
||||||
if gui.selectionRegionMode != mode {
|
if gui.selectionRegionMode != mode {
|
||||||
gui.selectionRegionMode = mode
|
gui.selectionRegionMode = mode
|
||||||
gui.terminal.SetDirty()
|
gui.terminal.NotifyDirty()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -436,12 +436,3 @@ func (terminal *Terminal) Lock() {
|
||||||
func (terminal *Terminal) Unlock() {
|
func (terminal *Terminal) Unlock() {
|
||||||
terminal.lock.Unlock()
|
terminal.lock.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetDirtyLocked sets dirty flag locking the terminal to prevent data race warnings
|
|
||||||
// @todo remove when switching to event-driven architecture
|
|
||||||
func (terminal *Terminal) SetDirtyLocked() {
|
|
||||||
terminal.Lock()
|
|
||||||
defer terminal.Unlock()
|
|
||||||
|
|
||||||
terminal.SetDirty()
|
|
||||||
}
|
|
||||||
|
|
|
@ -5,18 +5,18 @@ package main
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"errors"
|
"errors"
|
||||||
"golang.org/x/sys/windows/registry"
|
|
||||||
"os"
|
|
||||||
"os/user"
|
|
||||||
"strings"
|
|
||||||
"path/filepath"
|
|
||||||
"github.com/liamg/aminal/windows/winutil"
|
|
||||||
"github.com/liamg/aminal/generated-src/installer/data"
|
|
||||||
"text/template"
|
|
||||||
"io/ioutil"
|
|
||||||
"os/exec"
|
|
||||||
"syscall"
|
|
||||||
"flag"
|
"flag"
|
||||||
|
"github.com/liamg/aminal/generated-src/installer/data"
|
||||||
|
"github.com/liamg/aminal/windows/winutil"
|
||||||
|
"golang.org/x/sys/windows/registry"
|
||||||
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
|
"os/exec"
|
||||||
|
"os/user"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
"syscall"
|
||||||
|
"text/template"
|
||||||
)
|
)
|
||||||
|
|
||||||
const Version = "VERSION"
|
const Version = "VERSION"
|
||||||
|
|
|
@ -19,6 +19,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/liamg/aminal/windows/winutil"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
@ -26,7 +27,6 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"github.com/liamg/aminal/windows/winutil"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Version struct {
|
type Version struct {
|
||||||
|
|
Loading…
Reference in New Issue