Categorygithub.com/davidoram/extedit
repositorypackage
0.0.0-20220417002237-e225cd2b2002
Repository: https://github.com/davidoram/extedit.git
Documentation: pkg.go.dev

# README

extedit

Open an external editor as part of the user interface of a command-line programm. Think git rebase -i.

import (
    "strings"
    "github.com/davidoram/extedit"
)

func main() {
    input := strings.NewReader("Line 1\nLine 2")

    diff := extedit.Invoke(input)

    // diff.Lines() []string contains the edited input.
    // diff.Differences []int  contains indexes of changed lines.
}