This commit is contained in:
Felix Angell 2018-04-21 19:50:31 +01:00
parent a669134873
commit b654a4918d
6 changed files with 25 additions and 18 deletions

View File

@ -2,10 +2,10 @@ package cfg
import (
"errors"
"regexp"
"log"
"strconv"
"github.com/felixangell/strife"
"log"
"regexp"
"strconv"
)
type TomlConfig struct {

View File

@ -5,8 +5,8 @@ import (
"log"
"os"
"path/filepath"
"runtime"
"regexp"
"runtime"
"strings"
"github.com/felixangell/strife"

View File

@ -1,5 +1,7 @@
package gui
import "os"
type BufferAction func(*Buffer) bool
var actions = map[string]BufferAction{
@ -7,4 +9,9 @@ var actions = map[string]BufferAction{
"delete_line": DeleteLine,
"close_buffer": CloseBuffer,
"paste": Paste,
"exit": func(*Buffer) bool {
// TODO do this properly lol
os.Exit(0)
return false
},
}

View File

@ -2,9 +2,9 @@ package gui
import (
"bytes"
"github.com/atotto/clipboard"
"io/ioutil"
"log"
"github.com/atotto/clipboard"
)
func Paste(b *Buffer) bool {

View File

@ -6,7 +6,7 @@ type Lexer struct {
}
func New(input string) *Lexer {
return &Lexer {
return &Lexer{
pos: 0,
input: []rune(input),
}
@ -19,7 +19,7 @@ func (l *Lexer) consume() rune {
}
func (l *Lexer) next(offs int) rune {
return l.input[l.pos + offs]
return l.input[l.pos+offs]
}
func (l *Lexer) peek() rune {

View File

@ -15,7 +15,7 @@ type Token struct {
}
func NewToken(lexeme string, kind TokenType, start int) *Token {
return &Token {lexeme, kind, start}
return &Token{lexeme, kind, start}
}
func (t *Token) String() string {