mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-12 17:27:50 +08:00
Store a pointer to eval.Evaler in edit.Editor
This commit is contained in:
parent
5c64fa16e0
commit
cca6d75c36
|
@ -8,6 +8,7 @@ import (
|
|||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/elves/elvish/eval"
|
||||
"github.com/elves/elvish/store"
|
||||
"github.com/elves/elvish/sys"
|
||||
)
|
||||
|
@ -52,6 +53,7 @@ type Editor struct {
|
|||
sigs <-chan os.Signal
|
||||
histories []string
|
||||
store *store.Store
|
||||
evaler *eval.Evaler
|
||||
cmdSeq int
|
||||
editorState
|
||||
}
|
||||
|
@ -142,7 +144,7 @@ func (ed *Editor) nextHistory() bool {
|
|||
}
|
||||
|
||||
// NewEditor creates an Editor.
|
||||
func NewEditor(file *os.File, sigs <-chan os.Signal, st *store.Store) *Editor {
|
||||
func NewEditor(file *os.File, sigs <-chan os.Signal, ev *eval.Evaler, st *store.Store) *Editor {
|
||||
seq := -1
|
||||
if st != nil {
|
||||
var err error
|
||||
|
@ -159,6 +161,7 @@ func NewEditor(file *os.File, sigs <-chan os.Signal, st *store.Store) *Editor {
|
|||
reader: NewReader(file),
|
||||
sigs: sigs,
|
||||
store: st,
|
||||
evaler: ev,
|
||||
cmdSeq: seq,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user