Run of fresh-snapshots for golang-github-chzyer-readline

Try this locally (using silver-platter):

debian-svp new-upstream --snapshot golang-github-chzyer-readline 

Merge these changes:

git pull https://janitor.debian.net/git/golang-github-chzyer-readline fresh-snapshots/main

Summary

Merged new upstream version: 1.4+git20180603.2972be2 (was: 1.4+git20171103.a4d5111).

Diff

=== added file '.gitignore'
--- a/.gitignore	1970-01-01 00:00:00 +0000
+++ b/.gitignore	2017-12-08 01:17:16 +0000
@@ -0,0 +1,1 @@
+.vscode/*

=== modified file 'complete.go'
--- a/complete.go	2017-11-30 20:40:52 +0000
+++ b/complete.go	2019-05-09 01:18:44 +0000
@@ -203,7 +203,9 @@
 	// -1 to avoid reach the end of line
 	width := o.width - 1
 	colNum := width / colWidth
-	colWidth += (width - (colWidth * colNum)) / colNum
+	if colNum != 0 {
+		colWidth += (width - (colWidth * colNum)) / colNum
+	}
 
 	o.candidateColNum = colNum
 	buf := bufio.NewWriter(o.w)
@@ -219,7 +221,7 @@
 		}
 		buf.WriteString(string(same))
 		buf.WriteString(string(c))
-		buf.Write(bytes.Repeat([]byte(" "), colWidth-len(c)-len(same)))
+		buf.Write(bytes.Repeat([]byte(" "), colWidth-runes.WidthAll(c)-runes.WidthAll(same)))
 
 		if inSelect {
 			buf.WriteString("\033[0m")

=== modified file 'debian/changelog'
--- a/debian/changelog	2018-04-02 19:12:15 +0000
+++ b/debian/changelog	2019-05-09 01:18:44 +0000
@@ -1,8 +1,12 @@
-golang-github-chzyer-readline (1.4+git20171103.a4d5111-2) UNRELEASED; urgency=medium
+golang-github-chzyer-readline (1.4+git20180603.2972be2-1) UNRELEASED; urgency=medium
 
+  [ Alexandre Viau ]
   * Point Vcs-* urls to salsa.debian.org.
 
- -- Alexandre Viau <aviau@debian.org>  Mon, 02 Apr 2018 15:12:15 -0400
+  [ Debian Janitor ]
+  * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Thu, 09 May 2019 01:18:44 +0000
 
 golang-github-chzyer-readline (1.4+git20171103.a4d5111-1) unstable; urgency=medium
 

=== modified file 'operation.go'
--- a/operation.go	2017-11-30 20:40:52 +0000
+++ b/operation.go	2019-05-09 01:18:44 +0000
@@ -72,7 +72,7 @@
 		t:       t,
 		buf:     NewRuneBuffer(t, cfg.Prompt, cfg, width),
 		outchan: make(chan []rune),
-		errchan: make(chan error),
+		errchan: make(chan error, 1),
 	}
 	op.w = op.buf.w
 	op.SetConfig(cfg)

=== modified file 'readline.go'
--- a/readline.go	2017-11-30 20:40:52 +0000
+++ b/readline.go	2019-05-09 01:18:44 +0000
@@ -54,7 +54,7 @@
 
 	FuncGetWidth func() int
 
-	Stdin       io.Reader
+	Stdin       io.ReadCloser
 	StdinWriter io.Writer
 	Stdout      io.Writer
 	Stderr      io.Writer
@@ -274,6 +274,7 @@
 	if err := i.Terminal.Close(); err != nil {
 		return err
 	}
+	i.Config.Stdin.Close()
 	i.Operation.Close()
 	return nil
 }

=== modified file 'remote.go'
--- a/remote.go	2017-07-21 04:59:33 +0000
+++ b/remote.go	2019-05-09 01:18:44 +0000
@@ -189,11 +189,12 @@
 	}
 }
 
-func (r *RemoteSvr) Close() {
+func (r *RemoteSvr) Close() error {
 	if atomic.CompareAndSwapInt32(&r.closed, 0, 1) {
 		close(r.stopChan)
 		r.conn.Close()
 	}
+	return nil
 }
 
 func (r *RemoteSvr) readLoop(buf *bufio.Reader) {

=== modified file 'std.go'
--- a/std.go	2017-11-30 20:40:52 +0000
+++ b/std.go	2019-05-09 01:18:44 +0000
@@ -137,14 +137,13 @@
 type FillableStdin struct {
 	sync.Mutex
 	stdin       io.Reader
-	stdinBuffer io.Reader
+	stdinBuffer io.ReadCloser
 	buf         []byte
 	bufErr      error
 }
 
 // NewFillableStdin gives you FillableStdin
-func NewFillableStdin(stdin io.Reader) (io.Reader, io.Writer) {
-
+func NewFillableStdin(stdin io.Reader) (io.ReadCloser, io.Writer) {
 	r, w := io.Pipe()
 	s := &FillableStdin{
 		stdinBuffer: r,
@@ -152,7 +151,6 @@
 	}
 	s.ioloop()
 	return s, w
-
 }
 
 func (s *FillableStdin) ioloop() {
@@ -161,6 +159,11 @@
 			bufR := make([]byte, 100)
 			var n int
 			n, s.bufErr = s.stdinBuffer.Read(bufR)
+			if s.bufErr != nil {
+				if s.bufErr == io.ErrClosedPipe {
+					break
+				}
+			}
 			s.Lock()
 			s.buf = append(s.buf, bufR[:n]...)
 			s.Unlock()
@@ -184,7 +187,11 @@
 		return n, cerr
 	}
 	s.Unlock()
-
-	return s.stdin.Read(p)
-
+	n, err = s.stdin.Read(p)
+	return n, err
+}
+
+func (s *FillableStdin) Close() error {
+	s.stdinBuffer.Close()
+	return nil
 }

Full build log Full worker log