MCPcopy
hub / github.com/sammcj/gollama / externalEditorView

Method externalEditorView

app_model.go:1210–1245  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1208}
1209
1210func (m *AppModel) externalEditorView() string {
1211 headerStyle := styles.HeaderStyle()
1212 infoStyle := styles.InfoStyle()
1213 helpStyle := styles.HelpTextStyle()
1214 warningStyle := styles.WarningStyle()
1215
1216 // Create a styled border box around the content
1217 title := headerStyle.Render("🎨 External Editor Mode")
1218
1219 modelInfo := fmt.Sprintf("Editing modelfile for: %s", m.externalEditorModel)
1220 editorInfo := fmt.Sprintf("Temporary file: %s", m.externalEditorFile)
1221
1222 instructions := []string{
1223 warningStyle.Render("📝 Edit the Modelfile in your configured editor."),
1224 "",
1225 helpStyle.Render("💾 Press 's' to save after making your changes"),
1226 helpStyle.Render("🚪 Press any other key to return to the application"),
1227 }
1228
1229 content := []string{
1230 "",
1231 title,
1232 "",
1233 infoStyle.Render("🎯 " + modelInfo),
1234 infoStyle.Render("📁 " + editorInfo),
1235 "",
1236 }
1237
1238 for _, instruction := range instructions {
1239 content = append(content, instruction)
1240 }
1241
1242 content = append(content, "")
1243
1244 return strings.Join(content, "\n")
1245}
1246
1247// resetExternalEditorState resets all external editor state to initial values
1248func (m *AppModel) resetExternalEditorState() {

Callers 1

ViewMethod · 0.95

Calls 5

HeaderStyleFunction · 0.92
InfoStyleFunction · 0.92
HelpTextStyleFunction · 0.92
WarningStyleFunction · 0.92
RenderMethod · 0.80

Tested by

no test coverage detected