keep copy selections after paste (#745)

This commit is contained in:
Christian Zangl authored and GitHub committed 2022-02-04 19:21:03 +03:00
1 parent 958857f4c4
commit a4842e19d4
4 files changed
+17 -18

No files matched your search

+2 -2
View File
@@ -1098,9 +1098,9 @@ You can use the following example as a starting point:
cp -R $list .
elif [ $mode = 'move' ]; then
mv $list .
rm ~/.local/share/lf/files
lf -remote 'send clear'
fi
rm ~/.local/share/lf/files
lf -remote 'send clear'
}}
Some useful things to be considered are to use the backup ('--backup') and/or preserve attributes ('-a') options with 'cp' and 'mv' commands if they support it (i.e. GNU implementation), change the command type to asynchronous, or use 'rsync' command with progress bar option for copying and feed the progress to the client periodically with remote 'echo' calls.
+2 -2
View File
@@ -1215,9 +1215,9 @@ point:
cp -R $list .
elif [ $mode = 'move' ]; then
mv $list .
rm ~/.local/share/lf/files
lf -remote 'send clear'
fi
rm ~/.local/share/lf/files
lf -remote 'send clear'
}}
Some useful things to be considered are to use the backup ('--backup')
+2 -2
View File
@@ -1272,9 +1272,9 @@ You can customize copy and move operations by defining a 'paste' command. This i
cp -R $list .
elif [ $mode = 'move' ]; then
mv $list .
rm ~/.local/share/lf/files
lf -remote 'send clear'
fi
rm ~/.local/share/lf/files
lf -remote 'send clear'
}}
.EE
.PP
+11 -12
View File
@@ -1043,19 +1043,18 @@ func (nav *nav) paste(ui *ui) error {
go nav.copyAsync(ui, srcs, dstDir)
} else {
go nav.moveAsync(ui, srcs, dstDir)
}
if err := saveFiles(nil, false); err != nil {
return fmt.Errorf("clearing copy/cut buffer: %s", err)
}
if gSingleMode {
if err := nav.sync(); err != nil {
return fmt.Errorf("paste: %s", err)
if err := saveFiles(nil, false); err != nil {
return fmt.Errorf("clearing copy/cut buffer: %s", err)
}
} else {
if err := remote("send sync"); err != nil {
return fmt.Errorf("paste: %s", err)
if gSingleMode {
if err := nav.sync(); err != nil {
return fmt.Errorf("paste: %s", err)
}
} else {
if err := remote("send sync"); err != nil {
return fmt.Errorf("paste: %s", err)
}
}
}