Print message in status line after copying/moving (#427)

* Print message in status line after copying/moving

* Print message only when there's no errors

* Don't print number of copied files

* Fix error handling

* Send message to channel instead of direct ui.echo
This commit is contained in:
Alexey Yerin 2020-07-22 01:53:02 +03:00 committed by GitHub
parent 9c891307f3
commit c630293cc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

14
nav.go
View File

@ -694,6 +694,13 @@ loop:
echo.args[0] = fmt.Sprintf("[%d] %s", errCount, err)
ui.exprChan <- echo
}
if errCount == 0 {
echosuccess := &callExpr{"echo", []string{""}, 1}
echosuccess.args[0] = "\033[0;32mCopied successfully\033[0m"
ui.exprChan <- echosuccess
}
}
func (nav *nav) moveAsync(ui *ui, srcs []string, dstDir string) {
@ -790,6 +797,13 @@ func (nav *nav) moveAsync(ui *ui, srcs []string, dstDir string) {
echo.args[0] = fmt.Sprintf("[%d] %s", errCount, err)
ui.exprChan <- echo
}
if errCount == 0 {
echosuccess := &callExpr{"echo", []string{""}, 1}
echosuccess.args[0] = "\033[0;32mMoved successfully\033[0m"
ui.exprChan <- echosuccess
}
}
func (nav *nav) paste(ui *ui) error {