Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use x/editor #543

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"path"
"path/filepath"

"github.com/charmbracelet/glow/editor"
"github.com/charmbracelet/x/editor"
gap "github.com/muesli/go-app-paths"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -65,7 +65,7 @@ var configCmd = &cobra.Command{
return err
}

c, err := editor.Cmd(configFile)
c, err := editor.Cmd("Glow", configFile)
if err != nil {
return fmt.Errorf("could not edit %s: %w", configFile, err)
}
Expand Down
31 changes: 0 additions & 31 deletions editor/editor.go

This file was deleted.

37 changes: 0 additions & 37 deletions editor/editor_test.go

This file was deleted.

1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (
github.com/charmbracelet/charm v0.8.7
github.com/charmbracelet/glamour v0.6.0
github.com/charmbracelet/lipgloss v0.6.0
github.com/charmbracelet/x/editor v0.0.0-20231116172829-450eedbca1ab
github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac
github.com/mattn/go-runewidth v0.0.14
github.com/meowgorithm/babyenv v1.3.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ github.com/charmbracelet/glamour v0.6.0/go.mod h1:taqWV4swIMMbWALc0m7AfE9JkPSU8o
github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao=
github.com/charmbracelet/lipgloss v0.6.0 h1:1StyZB9vBSOyuZxQUcUwGr17JmojPNm87inij9N3wJY=
github.com/charmbracelet/lipgloss v0.6.0/go.mod h1:tHh2wr34xcHjC2HCXIlGSG1jaDF0S0atAUvBMP6Ppuk=
github.com/charmbracelet/x/editor v0.0.0-20231116172829-450eedbca1ab h1:95WbogoQheYFuAUy1olU8OgxrHk2K86zA7mSNELiMfU=
github.com/charmbracelet/x/editor v0.0.0-20231116172829-450eedbca1ab/go.mod h1:lrin7iXW742pX5pePBEWhLPDTp53YW15r/Lp4Rcfg0M=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
Expand Down
4 changes: 2 additions & 2 deletions ui/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package ui

import (
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/glow/editor"
"github.com/charmbracelet/x/editor"
)

type editorFinishedMsg struct{ err error }
Expand All @@ -12,7 +12,7 @@ func openEditor(path string) tea.Cmd {
return editorFinishedMsg{err}
}

editor, err := editor.Cmd(path)
editor, err := editor.Cmd("Glow", path)
if err != nil {
return func() tea.Msg {
return errMsg{err}
Expand Down
Loading