Merge pull request #5 from ebetica/piped_incorrect

Fix bug for when no input is piped but -q is used
pull/6/head v0.4.3
Tony Worm 1 year ago committed by GitHub
commit 1a77595a42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -168,7 +168,9 @@ func main() {
// no args, or interactive... read from stdin
// this is mainly for replacing text in vim
if len(args) == 0 && !PromptMode {
fi, _ := os.Stdin.Stat()
inputIsFromPipe = (fi.Mode() & os.ModeCharDevice) == 0
if len(args) == 0 && !PromptMode && inputIsFromPipe {
reader := bufio.NewReader(os.Stdin)
var buf bytes.Buffer
for {

Loading…
Cancel
Save