@@ -263,6 +263,9 @@ func (m *editorCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
263 Attachment: attachment,
263 Attachment: attachment,
266+ case commands.ToggleYoloModeMsg:
266 case tea.KeyPressMsg:
269 case tea.KeyPressMsg:
267 cur := m.textarea.Cursor()
270 cur := m.textarea.Cursor()
268 curIdx := m.textarea.Width()*cur.Y + cur.X
271 curIdx := m.textarea.Width()*cur.Y + cur.X
@@ -368,6 +371,14 @@ func (m *editorCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
368 return m, tea.Batch(cmds...)
371 return m, tea.Batch(cmds...)
374+func (m *editorCmp) setEditorPrompt() {
375+ if m.app.Permissions.SkipRequests() {
376+ m.textarea.SetPromptFunc(4, yoloPromptFunc)
379+ m.textarea.SetPromptFunc(4, normalPromptFunc)
371func (m *editorCmp) completionsPosition() (int, int) {
382func (m *editorCmp) completionsPosition() (int, int) {
372 cur := m.textarea.Cursor()
383 cur := m.textarea.Cursor()
373 if cur == nil {
384 if cur == nil {
@@ -416,6 +427,9 @@ func (m *editorCmp) View() string {
417 m.textarea.Placeholder = m.readyPlaceholder
428 m.textarea.Placeholder = m.readyPlaceholder
430+ if m.app.Permissions.SkipRequests() {
431+ m.textarea.Placeholder = "Yolo mode!"
419 if len(m.attachments) == 0 {
433 if len(m.attachments) == 0 {
420 content := t.S().Base.Padding(1).Render(
434 content := t.S().Base.Padding(1).Render(
421 m.textarea.View(),
435 m.textarea.View(),
@@ -529,31 +543,47 @@ func (c *editorCmp) HasAttachments() bool {
529 return len(c.attachments) > 0
543 return len(c.attachments) > 0
532−func New(app *app.App) Editor {
546+func normalPromptFunc(info textarea.PromptInfo) string {
533 t := styles.CurrentTheme()
547 t := styles.CurrentTheme()
534− ta := textarea.New()
548+ if info.LineNumber == 0 {
535− ta.SetStyles(t.S().TextArea)
549+ return " > "
552+ return t.S().Base.Foreground(t.GreenDark).Render("::: ")
554+ return t.S().Muted.Render("::: ")
536− ta.SetPromptFunc(4, func(info textarea.PromptInfo) string {
557+func yoloPromptFunc(info textarea.PromptInfo) string {
558+ t := styles.CurrentTheme()
537− if info.LineNumber == 0 {
559+ if info.LineNumber == 0 {
540 if info.Focused {
560 if info.Focused {
541− return t.S().Base.Foreground(t.GreenDark).Render("::: ")
561+ return fmt.Sprintf("%s ", t.YoloIconFocused)
543− return t.S().Muted.Render("::: ")
563+ return fmt.Sprintf("%s ", t.YoloIconBlurred)
567+ return fmt.Sprintf("%s ", t.YoloDotsFocused)
569+ return fmt.Sprintf("%s ", t.YoloDotsBlurred)
572+func New(app *app.App) Editor {
573+ t := styles.CurrentTheme()
574+ ta := textarea.New()
575+ ta.SetStyles(t.S().TextArea)
546 ta.ShowLineNumbers = false
576 ta.ShowLineNumbers = false
547 ta.CharLimit = -1
577 ta.CharLimit = -1
548 ta.SetVirtualCursor(false)
578 ta.SetVirtualCursor(false)
549 ta.Focus()
579 ta.Focus()
551 e := &editorCmp{
580 e := &editorCmp{
552 // TODO: remove the app instance from here
581 // TODO: remove the app instance from here
553 app: app,
582 app: app,
554 textarea: ta,
583 textarea: ta,
555 keyMap: DefaultEditorKeyMap(),
584 keyMap: DefaultEditorKeyMap(),
558 e.randomizePlaceholders()
588 e.randomizePlaceholders()
559 e.textarea.Placeholder = e.readyPlaceholder
589 e.textarea.Placeholder = e.readyPlaceholder