MCPcopy
hub / github.com/docker/docker-agent / editorOpts

Method editorOpts

pkg/tui/tui.go:552–563  ·  view source on GitHub ↗

editorOpts returns the editor.Option slice derived from the current appModel.

()

Source from the content-addressed store, hash-verified

550
551// editorOpts returns the editor.Option slice derived from the current appModel.
552func (m *appModel) editorOpts() []editor.Option {
553 opts := []editor.Option{
554 editor.WithCompletions(
555 completions.NewCommandCompletion(m.commandCategories()),
556 completions.NewFileCompletion(m.ctx()),
557 ),
558 }
559 if m.application.IsReadOnly() {
560 opts = append(opts, editor.WithReadOnly())
561 }
562 return opts
563}
564
565// initSessionComponents creates a new chat page, session state, and editor for
566// the given app and stores them in the per-session maps under tabID. The active

Callers 2

NewFunction · 0.95
initSessionComponentsMethod · 0.95

Calls 6

commandCategoriesMethod · 0.95
WithCompletionsFunction · 0.92
NewCommandCompletionFunction · 0.92
NewFileCompletionFunction · 0.92
WithReadOnlyFunction · 0.92
IsReadOnlyMethod · 0.80

Tested by

no test coverage detected