Fix bug for when no input is piped but -q is used

pull/5/head
Zeming Lin 1 year ago
parent 6a2bc49b98
commit a4674e2601

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