mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-13 09:57:51 +08:00
newedit/core -> newedit/clicore.
This commit is contained in:
parent
5eaec24f11
commit
0e5341b8ce
|
@ -1,4 +1,4 @@
|
|||
package core
|
||||
package clicore
|
||||
|
||||
import (
|
||||
"sync"
|
|
@ -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.
|
||||
//
|
||||
// The center of this package is the Editor type. Most other types are either
|
||||
// states managed by the Editor or dependencies of the Editor.
|
||||
package core
|
||||
package clicore
|
|
@ -1,4 +1,4 @@
|
|||
package core
|
||||
package clicore
|
||||
|
||||
import (
|
||||
"io"
|
|
@ -1,4 +1,4 @@
|
|||
package core
|
||||
package clicore
|
||||
|
||||
import (
|
||||
"errors"
|
|
@ -1,4 +1,4 @@
|
|||
package core
|
||||
package clicore
|
||||
|
||||
import (
|
||||
"fmt"
|
|
@ -1,4 +1,4 @@
|
|||
package core
|
||||
package clicore
|
||||
|
||||
import "os"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package core
|
||||
package clicore
|
||||
|
||||
import (
|
||||
"reflect"
|
|
@ -1,4 +1,4 @@
|
|||
package core
|
||||
package clicore
|
||||
|
||||
import "github.com/elves/elvish/styled"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package core
|
||||
package clicore
|
||||
|
||||
import "sync"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package core
|
||||
package clicore
|
||||
|
||||
import "fmt"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package core
|
||||
package clicore
|
||||
|
||||
import (
|
||||
"reflect"
|
|
@ -1,4 +1,4 @@
|
|||
package core
|
||||
package clicore
|
||||
|
||||
import "github.com/elves/elvish/styled"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package core
|
||||
package clicore
|
||||
|
||||
import (
|
||||
"github.com/elves/elvish/edit/ui"
|
|
@ -1,4 +1,4 @@
|
|||
package core
|
||||
package clicore
|
||||
|
||||
import (
|
||||
"errors"
|
|
@ -1,4 +1,4 @@
|
|||
package core
|
||||
package clicore
|
||||
|
||||
import (
|
||||
"os"
|
|
@ -1,6 +1,6 @@
|
|||
// +build !windows,!plan9
|
||||
|
||||
package core
|
||||
package clicore
|
||||
|
||||
import (
|
||||
"testing"
|
|
@ -1,4 +1,4 @@
|
|||
package core
|
||||
package clicore
|
||||
|
||||
import (
|
||||
"fmt"
|
|
@ -1,4 +1,4 @@
|
|||
package core
|
||||
package clicore
|
||||
|
||||
import (
|
||||
"github.com/elves/elvish/newedit/editutil"
|
|
@ -6,7 +6,7 @@ import "github.com/elves/elvish/newedit/types"
|
|||
// This file defines the interfaces for those dependencies as well as fake
|
||||
// implementations that are useful in tests.
|
||||
|
||||
// Interface for the core.Editor dependency.
|
||||
// Interface for the clicore.Editor dependency.
|
||||
type editor interface {
|
||||
notifier
|
||||
State() *types.State
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"github.com/elves/elvish/edit/history/histutil"
|
||||
"github.com/elves/elvish/eval"
|
||||
"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/parse"
|
||||
"github.com/elves/elvish/store/storedefs"
|
||||
|
@ -20,13 +20,13 @@ import (
|
|||
//
|
||||
// TODO: Rename ReadLine to ReadCode and remove Close.
|
||||
type Editor struct {
|
||||
core *core.Editor
|
||||
core *clicore.Editor
|
||||
ns eval.Ns
|
||||
}
|
||||
|
||||
// NewEditor creates a new editor from input and output terminal files.
|
||||
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(
|
||||
highlight.Dep{Check: makeCheck(ev), HasCommand: makeHasCommand(ev)})
|
||||
|
|
|
@ -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
|
||||
|
||||
import (
|
||||
|
|
|
@ -10,13 +10,13 @@ import (
|
|||
"github.com/elves/elvish/eval"
|
||||
"github.com/elves/elvish/eval/vals"
|
||||
"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/styled"
|
||||
"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
|
||||
ns[name] = vars.FromPtr(&compute)
|
||||
return prompt.New(func() styled.Text {
|
||||
|
|
Loading…
Reference in New Issue
Block a user