Store ChromaHighlighter in lmcli.Context and use it
In preparation for TUI
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"git.mlow.ca/mlow/lmcli/pkg/lmcli/provider"
|
||||
"git.mlow.ca/mlow/lmcli/pkg/lmcli/provider/anthropic"
|
||||
"git.mlow.ca/mlow/lmcli/pkg/lmcli/provider/openai"
|
||||
"git.mlow.ca/mlow/lmcli/pkg/util/tty"
|
||||
"gorm.io/driver/sqlite"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
@@ -15,6 +16,8 @@ import (
|
||||
type Context struct {
|
||||
Config Config
|
||||
Store ConversationStore
|
||||
|
||||
Chroma *tty.ChromaHighlighter
|
||||
}
|
||||
|
||||
func NewContext() (*Context, error) {
|
||||
@@ -34,7 +37,9 @@ func NewContext() (*Context, error) {
|
||||
Fatal("%v\n", err)
|
||||
}
|
||||
|
||||
return &Context{*config, s}, nil
|
||||
hl := tty.NewChromaHighlighter("markdown", *config.Chroma.Formatter, *config.Chroma.Style)
|
||||
|
||||
return &Context{*config, s, hl}, nil
|
||||
}
|
||||
|
||||
func (c *Context) GetCompletionProvider(model string) (provider.ChatCompletionClient, error) {
|
||||
|
||||
Reference in New Issue
Block a user