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:
parent
9c891307f3
commit
c630293cc2
14
nav.go
14
nav.go
@ -694,6 +694,13 @@ loop:
|
|||||||
echo.args[0] = fmt.Sprintf("[%d] %s", errCount, err)
|
echo.args[0] = fmt.Sprintf("[%d] %s", errCount, err)
|
||||||
ui.exprChan <- echo
|
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) {
|
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)
|
echo.args[0] = fmt.Sprintf("[%d] %s", errCount, err)
|
||||||
ui.exprChan <- echo
|
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 {
|
func (nav *nav) paste(ui *ui) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user