newedit/core -> newedit/clicore.

This commit is contained in:
Qi Xiao 2019-04-25 09:25:03 +01:00
parent 5eaec24f11
commit 0e5341b8ce
22 changed files with 26 additions and 26 deletions

View File

@ -1,4 +1,4 @@
package core package clicore
import ( import (
"sync" "sync"

View File

@ -1,6 +1,6 @@
// Package core defines the core of Elvish's interactive line editor. It is // Package clicore defines the core of Elvish's interactive line editor. It is
// language-agnostic and can be used to build editors for other languages. // language-agnostic and can be used to build editors for other languages.
// //
// The center of this package is the Editor type. Most other types are either // The center of this package is the Editor type. Most other types are either
// states managed by the Editor or dependencies of the Editor. // states managed by the Editor or dependencies of the Editor.
package core package clicore

View File

@ -1,4 +1,4 @@
package core package clicore
import ( import (
"io" "io"

View File

@ -1,4 +1,4 @@
package core package clicore
import ( import (
"errors" "errors"

View File

@ -1,4 +1,4 @@
package core package clicore
import ( import (
"fmt" "fmt"

View File

@ -1,4 +1,4 @@
package core package clicore
import "os" import "os"

View File

@ -1,4 +1,4 @@
package core package clicore
import ( import (
"reflect" "reflect"

View File

@ -1,4 +1,4 @@
package core package clicore
import "github.com/elves/elvish/styled" import "github.com/elves/elvish/styled"

View File

@ -1,4 +1,4 @@
package core package clicore
import "sync" import "sync"

View File

@ -1,4 +1,4 @@
package core package clicore
import "fmt" import "fmt"

View File

@ -1,4 +1,4 @@
package core package clicore
import ( import (
"reflect" "reflect"

View File

@ -1,4 +1,4 @@
package core package clicore
import "github.com/elves/elvish/styled" import "github.com/elves/elvish/styled"

View File

@ -1,4 +1,4 @@
package core package clicore
import ( import (
"github.com/elves/elvish/edit/ui" "github.com/elves/elvish/edit/ui"

View File

@ -1,4 +1,4 @@
package core package clicore
import ( import (
"errors" "errors"

View File

@ -1,4 +1,4 @@
package core package clicore
import ( import (
"os" "os"

View File

@ -1,6 +1,6 @@
// +build !windows,!plan9 // +build !windows,!plan9
package core package clicore
import ( import (
"testing" "testing"

View File

@ -1,4 +1,4 @@
package core package clicore
import ( import (
"fmt" "fmt"

View File

@ -1,4 +1,4 @@
package core package clicore
import ( import (
"github.com/elves/elvish/newedit/editutil" "github.com/elves/elvish/newedit/editutil"

View File

@ -6,7 +6,7 @@ import "github.com/elves/elvish/newedit/types"
// This file defines the interfaces for those dependencies as well as fake // This file defines the interfaces for those dependencies as well as fake
// implementations that are useful in tests. // implementations that are useful in tests.
// Interface for the core.Editor dependency. // Interface for the clicore.Editor dependency.
type editor interface { type editor interface {
notifier notifier
State() *types.State State() *types.State

View File

@ -7,7 +7,7 @@ import (
"github.com/elves/elvish/edit/history/histutil" "github.com/elves/elvish/edit/history/histutil"
"github.com/elves/elvish/eval" "github.com/elves/elvish/eval"
"github.com/elves/elvish/eval/vars" "github.com/elves/elvish/eval/vars"
"github.com/elves/elvish/newedit/core" "github.com/elves/elvish/newedit/clicore"
"github.com/elves/elvish/newedit/highlight" "github.com/elves/elvish/newedit/highlight"
"github.com/elves/elvish/parse" "github.com/elves/elvish/parse"
"github.com/elves/elvish/store/storedefs" "github.com/elves/elvish/store/storedefs"
@ -20,13 +20,13 @@ import (
// //
// TODO: Rename ReadLine to ReadCode and remove Close. // TODO: Rename ReadLine to ReadCode and remove Close.
type Editor struct { type Editor struct {
core *core.Editor core *clicore.Editor
ns eval.Ns ns eval.Ns
} }
// NewEditor creates a new editor from input and output terminal files. // NewEditor creates a new editor from input and output terminal files.
func NewEditor(in, out *os.File, ev *eval.Evaler, st storedefs.Store) *Editor { func NewEditor(in, out *os.File, ev *eval.Evaler, st storedefs.Store) *Editor {
ed := core.NewEditor(core.NewTTY(in, out), core.NewSignalSource()) ed := clicore.NewEditor(clicore.NewTTY(in, out), clicore.NewSignalSource())
ed.Highlighter = highlight.NewHighlighter( ed.Highlighter = highlight.NewHighlighter(
highlight.Dep{Check: makeCheck(ev), HasCommand: makeHasCommand(ev)}) highlight.Dep{Check: makeCheck(ev), HasCommand: makeHasCommand(ev)})

View File

@ -1,4 +1,4 @@
// Package prompt provides an implementation of the core.Prompt interface. // Package prompt provides an implementation of the clicore.Prompt interface.
package prompt package prompt
import ( import (

View File

@ -10,13 +10,13 @@ import (
"github.com/elves/elvish/eval" "github.com/elves/elvish/eval"
"github.com/elves/elvish/eval/vals" "github.com/elves/elvish/eval/vals"
"github.com/elves/elvish/eval/vars" "github.com/elves/elvish/eval/vars"
"github.com/elves/elvish/newedit/core" "github.com/elves/elvish/newedit/clicore"
"github.com/elves/elvish/newedit/prompt" "github.com/elves/elvish/newedit/prompt"
"github.com/elves/elvish/styled" "github.com/elves/elvish/styled"
"github.com/elves/elvish/util" "github.com/elves/elvish/util"
) )
func makePrompt(nt notifier, ev *eval.Evaler, ns eval.Ns, computeInit eval.Callable, name string) core.Prompt { func makePrompt(nt notifier, ev *eval.Evaler, ns eval.Ns, computeInit eval.Callable, name string) clicore.Prompt {
compute := computeInit compute := computeInit
ns[name] = vars.FromPtr(&compute) ns[name] = vars.FromPtr(&compute)
return prompt.New(func() styled.Text { return prompt.New(func() styled.Text {