Compare commits

...

2 Commits

Author SHA1 Message Date
Tony Worm 1a77595a42
Merge pull request #5 from ebetica/piped_incorrect
Fix bug for when no input is piped but -q is used
1 year ago
Zeming Lin a4674e2601 Fix bug for when no input is piped but -q is used 1 year ago

@ -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