Compare commits

...

3 Commits

Author SHA1 Message Date
79a61d5a3b
Fix: again 2022-07-08 05:59:21 -07:00
924f153852
Update deps && Fix breaking changes 2022-06-14 21:44:49 -07:00
fffc19cba2
fix path 2022-02-17 04:00:55 -08:00
25 changed files with 58 additions and 51 deletions

0
_example/build.sh Executable file → Normal file

@ -4,7 +4,7 @@ import (
"os"
"os/exec"
prompt "git.tcp.direct/tcp.direct/go-prompt"
prompt "git.tcp.direct/Mirrors/go-prompt"
)
func executor(t string) {

@ -10,7 +10,7 @@ import (
"path"
"strings"
prompt "git.tcp.direct/tcp.direct/go-prompt"
prompt "git.tcp.direct/Mirrors/go-prompt"
)
type RequestContext struct {

@ -3,7 +3,7 @@ package main
import (
"fmt"
prompt "git.tcp.direct/tcp.direct/go-prompt"
prompt "git.tcp.direct/Mirrors/go-prompt"
)
var LivePrefixState struct {

@ -3,7 +3,7 @@ package main
import (
"fmt"
prompt "git.tcp.direct/tcp.direct/go-prompt"
prompt "git.tcp.direct/Mirrors/go-prompt"
)
func executor(in string) {

@ -3,7 +3,7 @@ package main
import (
"fmt"
prompt "git.tcp.direct/tcp.direct/go-prompt"
prompt "git.tcp.direct/Mirrors/go-prompt"
)
func completer(in prompt.Document) []prompt.Suggest {

@ -5,8 +5,8 @@ import (
"os"
"strings"
prompt "git.tcp.direct/tcp.direct/go-prompt"
"git.tcp.direct/tcp.direct/go-prompt/completer"
prompt "git.tcp.direct/Mirrors/go-prompt"
"git.tcp.direct/Mirrors/go-prompt/completer"
)
var filePathCompleter = completer.FilePathCompleter{

@ -6,8 +6,8 @@ import (
"fmt"
"syscall"
prompt "git.tcp.direct/tcp.direct/go-prompt"
"git.tcp.direct/tcp.direct/go-prompt/internal/term"
prompt "git.tcp.direct/Mirrors/go-prompt"
"git.tcp.direct/Mirrors/go-prompt/internal/term"
)
func main() {

@ -3,7 +3,7 @@ package prompt
import (
"strings"
"git.tcp.direct/tcp.direct/go-prompt/internal/debug"
"git.tcp.direct/Mirrors/go-prompt/internal/debug"
)
// Buffer emulates the console buffer.

@ -7,8 +7,8 @@ import (
"path/filepath"
"runtime"
prompt "git.tcp.direct/tcp.direct/go-prompt"
"git.tcp.direct/tcp.direct/go-prompt/internal/debug"
prompt "git.tcp.direct/Mirrors/go-prompt"
"git.tcp.direct/Mirrors/go-prompt/internal/debug"
)
var (

@ -3,7 +3,7 @@ package prompt
import (
"strings"
"git.tcp.direct/tcp.direct/go-prompt/internal/debug"
"git.tcp.direct/Mirrors/go-prompt/internal/debug"
runewidth "github.com/mattn/go-runewidth"
)

@ -4,8 +4,8 @@ import (
"strings"
"unicode/utf8"
"git.tcp.direct/tcp.direct/go-prompt/internal/bisect"
istrings "git.tcp.direct/tcp.direct/go-prompt/internal/strings"
"git.tcp.direct/Mirrors/go-prompt/internal/bisect"
istrings "git.tcp.direct/Mirrors/go-prompt/internal/strings"
runewidth "github.com/mattn/go-runewidth"
)

@ -242,7 +242,7 @@ func TestDocument_DisplayCursorPosition(t *testing.T) {
// If you're facing test failure on this test case and your terminal is iTerm2,
// please check 'Profile -> Text' configuration. 'Use Unicode version 9 widths'
// must be checked.
// https://git.tcp.direct/tcp.direct/go-prompt/pull/99
// https://git.tcp.direct/Mirrors/go-prompt/pull/99
document: &Document{
Text: "Добрый день",
cursorPosition: 3,

@ -1,6 +1,6 @@
package prompt
import "git.tcp.direct/tcp.direct/go-prompt/internal/debug"
import "git.tcp.direct/Mirrors/go-prompt/internal/debug"
/*

19
go.mod

@ -1,11 +1,16 @@
module git.tcp.direct/tcp.direct/go-prompt
module git.tcp.direct/Mirrors/go-prompt
go 1.14
go 1.18
require (
github.com/mattn/go-colorable v0.1.7
github.com/mattn/go-runewidth v0.0.9
github.com/mattn/go-tty v0.0.3
github.com/pkg/term v1.2.0-beta.2
golang.org/x/sys v0.0.0-20200918174421-af09f7315aff
github.com/mattn/go-colorable v0.1.12
github.com/mattn/go-runewidth v0.0.13
github.com/mattn/go-tty v0.0.4
github.com/pkg/term v1.1.0
golang.org/x/sys v0.0.0-20220614162138-6c1b26c55098
)
require (
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
)

33
go.sum

@ -1,23 +1,24 @@
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw=
github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-tty v0.0.3 h1:5OfyWorkyO7xP52Mq7tB36ajHDG5OHrmBGIS/DtakQI=
github.com/mattn/go-tty v0.0.3/go.mod h1:ihxohKRERHTVzN+aSVRwACLCeqIoZAWpoICkkvrWyR0=
github.com/pkg/term v1.2.0-beta.2 h1:L3y/h2jkuBVFdWiJvNfYfKmzcCnILw7mJWm2JQuMppw=
github.com/pkg/term v1.2.0-beta.2/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-tty v0.0.4 h1:NVikla9X8MN0SQAqCYzpGyXv0jY7MNl3HOWD2dkle7E=
github.com/mattn/go-tty v0.0.4/go.mod h1:u5GGXBtZU6RQoKV8gY5W6UhMudbR5vXnUe7j3pxse28=
github.com/pkg/term v1.1.0 h1:xIAAdCMh3QIAy+5FrE8Ad8XoDhEU4ufwbaSozViP9kk=
github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200918174421-af09f7315aff h1:1CPUrky56AcgSpxz/KfgzQWzfG09u5YOL8MvPYBlrL8=
golang.org/x/sys v0.0.0-20200918174421-af09f7315aff/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220614162138-6c1b26c55098 h1:PgOr27OhUx2IRqGJ2RxAWI4dJQ7bi9cSrB82uzFzfUA=
golang.org/x/sys v0.0.0-20220614162138-6c1b26c55098/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

@ -5,7 +5,7 @@ package prompt
import (
"syscall"
"git.tcp.direct/tcp.direct/go-prompt/internal/term"
"git.tcp.direct/Mirrors/go-prompt/internal/term"
"golang.org/x/sys/unix"
)

@ -5,7 +5,7 @@ import (
"math/rand"
"testing"
"git.tcp.direct/tcp.direct/go-prompt/internal/bisect"
"git.tcp.direct/Mirrors/go-prompt/internal/bisect"
)
func Example() {

@ -3,7 +3,7 @@ package strings_test
import (
"fmt"
"git.tcp.direct/tcp.direct/go-prompt/internal/strings"
"git.tcp.direct/Mirrors/go-prompt/internal/strings"
)
func ExampleIndexNotByte() {

@ -1,3 +1,4 @@
//go:build !windows
// +build !windows
package term
@ -19,9 +20,9 @@ func getOriginalTermios(fd int) (unix.Termios, error) {
var err error
saveTermiosOnce.Do(func() {
saveTermiosFD = fd
var saveTermiosPtr *unix.Termios
saveTermiosPtr, err = termios.Tcgetattr(uintptr(fd))
saveTermios = *saveTermiosPtr
var saveTermiosPtr unix.Termios
err = termios.Tcgetattr(uintptr(fd), &saveTermiosPtr)
saveTermios = saveTermiosPtr
})
return saveTermios, err
}

@ -214,7 +214,7 @@ func (w *VT100Writer) SetColor(fg, bg Color, bold bool) {
w.SetDisplayAttributes(fg, bg, DisplayBold)
} else {
// If using `DisplayDefualt`, it will be broken in some environment.
// Details are https://git.tcp.direct/tcp.direct/go-prompt/pull/85
// Details are https://git.tcp.direct/Mirrors/go-prompt/pull/85
w.SetDisplayAttributes(fg, bg, DisplayReset)
}
}

@ -5,7 +5,7 @@ import (
"os"
"time"
"git.tcp.direct/tcp.direct/go-prompt/internal/debug"
"git.tcp.direct/Mirrors/go-prompt/internal/debug"
)
// Executor is called when user input something text.

@ -3,7 +3,7 @@ package prompt
import (
"runtime"
"git.tcp.direct/tcp.direct/go-prompt/internal/debug"
"git.tcp.direct/Mirrors/go-prompt/internal/debug"
runewidth "github.com/mattn/go-runewidth"
)

@ -7,7 +7,7 @@ import (
"os/signal"
"syscall"
"git.tcp.direct/tcp.direct/go-prompt/internal/debug"
"git.tcp.direct/Mirrors/go-prompt/internal/debug"
)
func (p *Prompt) handleSignals(exitCh chan int, winSizeCh chan *WinSize, stop chan struct{}) {

@ -7,7 +7,7 @@ import (
"os/signal"
"syscall"
"git.tcp.direct/tcp.direct/go-prompt/internal/debug"
"git.tcp.direct/Mirrors/go-prompt/internal/debug"
)
func (p *Prompt) handleSignals(exitCh chan int, winSizeCh chan *WinSize, stop chan struct{}) {