Cheer Xiao 10 år sedan
förälder
incheckning
42fcb8eb22
10 ändrade filer med 28 tillägg och 18 borttagningar
  1. 2 1
      edit/completion.go
  2. 3 2
      edit/editor.go
  3. 3 2
      edit/reader.go
  4. 5 4
      edit/writer.go
  5. 3 2
      eval/eval.go
  6. 3 2
      eval/exec.go
  7. 2 1
      eval/value.go
  8. 3 2
      main.go
  9. 2 1
      parse/parse.go
  10. 2 1
      parse/parse_test.go

+ 2 - 1
edit/completion.go

@@ -2,8 +2,9 @@ package edit
 
 import (
 	"fmt"
-	"github.com/xiaq/elvish/parse"
 	"io/ioutil"
+
+	"github.com/xiaq/elvish/parse"
 )
 
 type tokenPart struct {

+ 3 - 2
edit/editor.go

@@ -3,12 +3,13 @@ package edit
 
 import (
 	"fmt"
+	"os"
+	"strings"
+
 	"github.com/xiaq/elvish/edit/tty"
 	"github.com/xiaq/elvish/eval"
 	"github.com/xiaq/elvish/parse"
 	"github.com/xiaq/elvish/util"
-	"os"
-	"strings"
 )
 
 var LackEOL = "\033[7m\u23ce\033[m\n"

+ 3 - 2
edit/reader.go

@@ -3,8 +3,9 @@ package edit
 import (
 	"bufio"
 	"fmt"
-	"github.com/xiaq/elvish/util"
 	"time"
+
+	"github.com/xiaq/elvish/util"
 )
 
 var EscTimeout = time.Millisecond * 10
@@ -80,7 +81,7 @@ func (rd *reader) readRune() (r rune) {
 }
 
 func (rd *reader) unreadRune(r ...rune) {
-	// BUG(xiaq): reader.unreadRune doesn't back up rd.currentSeq 
+	// BUG(xiaq): reader.unreadRune doesn't back up rd.currentSeq
 	rd.unreadBuffer = append(rd.unreadBuffer, r...)
 }
 

+ 5 - 4
edit/writer.go

@@ -3,12 +3,13 @@ package edit
 import (
 	"bytes"
 	"fmt"
-	"github.com/xiaq/elvish/edit/tty"
-	"github.com/xiaq/elvish/util"
 	"os"
 	"strings"
 	"unicode"
 	"unicode/utf8"
+
+	"github.com/xiaq/elvish/edit/tty"
+	"github.com/xiaq/elvish/util"
 )
 
 // cell is an indivisible unit on the screen. It is not necessarily 1 column
@@ -250,7 +251,7 @@ tokens:
 				}
 				suppress = true
 			}
-			if bs.mode== modeHistory && i == len(bs.history.prefix) {
+			if bs.mode == modeHistory && i == len(bs.history.prefix) {
 				break tokens
 			}
 			if bs.dot == i {
@@ -259,7 +260,7 @@ tokens:
 		}
 	}
 
-	if bs.mode== modeHistory {
+	if bs.mode == modeHistory {
 		// Put the rest of current history, position the cursor at the
 		// end of the line, and finish writing
 		h := bs.history

+ 3 - 2
eval/eval.go

@@ -4,12 +4,13 @@ package eval
 
 import (
 	"fmt"
-	"github.com/xiaq/elvish/parse"
-	"github.com/xiaq/elvish/util"
 	"os"
 	"strconv"
 	"strings"
 	"syscall"
+
+	"github.com/xiaq/elvish/parse"
+	"github.com/xiaq/elvish/util"
 )
 
 // Evaluator maintains runtime context of elvish code within a single

+ 3 - 2
eval/exec.go

@@ -2,11 +2,12 @@ package eval
 
 import (
 	"fmt"
-	"github.com/xiaq/elvish/parse"
-	"github.com/xiaq/elvish/util"
 	"os"
 	"strings"
 	"syscall"
+
+	"github.com/xiaq/elvish/parse"
+	"github.com/xiaq/elvish/util"
 )
 
 const (

+ 2 - 1
eval/value.go

@@ -3,11 +3,12 @@ package eval
 import (
 	"bytes"
 	"fmt"
-	"github.com/xiaq/elvish/parse"
 	"strconv"
 	"strings"
 	"unicode"
 	"unicode/utf8"
+
+	"github.com/xiaq/elvish/parse"
 )
 
 func quote(s string) string {

+ 3 - 2
main.go

@@ -4,12 +4,13 @@ package main
 
 import (
 	"fmt"
+	"os"
+	"os/user"
+
 	"github.com/xiaq/elvish/edit"
 	"github.com/xiaq/elvish/eval"
 	"github.com/xiaq/elvish/parse"
 	"github.com/xiaq/elvish/util"
-	"os"
-	"os/user"
 )
 
 func main() {

+ 2 - 1
parse/parse.go

@@ -8,10 +8,11 @@ package parse
 
 import (
 	"fmt"
-	"github.com/xiaq/elvish/util"
 	"os"
 	"strconv"
 	"strings"
+
+	"github.com/xiaq/elvish/util"
 )
 
 // Parser maintains the states during parsing.

+ 2 - 1
parse/parse_test.go

@@ -2,9 +2,10 @@ package parse
 
 import (
 	"fmt"
-	"github.com/xiaq/elvish/util"
 	"reflect"
 	"testing"
+
+	"github.com/xiaq/elvish/util"
 )
 
 var parseTests = []struct {