From a40d29ba9f5673523dfdf28e17d448a3cb8da1f8 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sun, 14 Jan 2018 01:43:30 +0530 Subject: Support multiple file path copy Design overview: We are introducing multiple file path copy as a mode which can be toggled using the keybind `^Y`. `^K` works as the individual entry selector. If the user wants to select a range, (s)he can press `^Y` on the first entry and `^Y` on the last entry. We subscribe to notifications, so we need a fail-proof way to detect changes in the directory contents. For example, if a file is deleted, it becomes difficult to get the names of all the files in a range containing that file. If the file is on a range boundary it would lead to wrong calculations. To handle this the right way we use CRC8 checksum of all the visible entries in the directory. The checksum is calculated based on the file information buffer. If the CRC changes on a redraw(), we reset the multi-select mode. New line (`\n`) works as the delimiter between file paths. Note that you may have to disable IFS in the `NNN_COPIER` script to show file paths separated by spaces. --- scripts/copier/copier.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/copier/copier.sh b/scripts/copier/copier.sh index 90d2a26..5629301 100755 --- a/scripts/copier/copier.sh +++ b/scripts/copier/copier.sh @@ -1,3 +1,5 @@ #!/bin/sh +# comment the next line to convert newlines to spaces +IFS= echo -n $1 | `xsel --clipboard --input` -- cgit v1.2.3-70-g09d2