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 authored and GitHub committed 2020-07-22 01:53:02 +03:00
1 parent 9c891307f3
commit c630293cc2
1 file changed
+14
+14
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 {