]> Sergey Matveev's repositories - nnn.git/commitdiff
Support traversal on creation, update docs
authorArun Prakash Jana <engineerarun@gmail.com>
Sat, 8 Aug 2020 04:46:11 +0000 (10:16 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sat, 8 Aug 2020 05:12:37 +0000 (10:42 +0530)
README.md
src/nnn.c

index 7161d877848af7f5459613a60f113ad18cc50d7d..c1bc64418a3fc9f55d8a907ecf68b9d60ecbe9d7 100644 (file)
--- a/README.md
+++ b/README.md
@@ -64,10 +64,10 @@ It runs smoothly on the Pi, [Termux](https://www.youtube.com/watch?v=AbaauM7gUJw
   - Disk-IO sensitive (few disk reads and writes)
   - No FPU usage (all integer maths, even for file size)
   - Minimizes screen refresh with fast line redraws
-  - Tiny binary (typically less than 100KB)
+  - Tiny binary (typically around 100KB)
 - Portable
-  - Static binary available (no need to install)
   - Language-agnostic plugins
+  - Static binary available (no need to install)
   - Minimal library deps, easy to compile
   - Compile in/out features with make variables
   - No config file, minimal config with sensible defaults
@@ -86,7 +86,7 @@ It runs smoothly on the Pi, [Termux](https://www.youtube.com/watch?v=AbaauM7gUJw
   - Contexts (_aka_ tabs/workspaces) with custom colors
   - Sessions, bookmarks with hotkeys; mark and visit a dir
   - Remote mounts (needs sshfs, rclone)
-  - Familiar shortcuts (arrows, <kbd>~</kbd>, <kbd>-</kbd>, <kbd>@</kbd>), quick reference
+  - Familiar shortcuts (arrows, <kbd>~</kbd>, <kbd>-</kbd>, <kbd>@</kbd>), quick look-up
   - CD on quit (*easy* shell integration)
   - Auto-advance on opening files
 - Search
@@ -96,11 +96,12 @@ It runs smoothly on the Pi, [Termux](https://www.youtube.com/watch?v=AbaauM7gUJw
 - Sort
   - Ordered pure numeric names by default (visit _/proc_)
   - Case-insensitive version (_aka_ natural) sort
-  - By file name, access/change/mod (default) time, size, extension
+  - By name, access/change/mod (default) time, size, extn
   - Reverse sort
 - Mimes
   - Open with desktop opener or specify a custom opener
   - Preview hovered files in FIFO-based previewer
+  - Plugins for image and video thumbnails
   - Create, list, extract, mount (FUSE based) archives
   - Option to open all text files in EDITOR
 - Information
@@ -115,8 +116,8 @@ It runs smoothly on the Pi, [Termux](https://www.youtube.com/watch?v=AbaauM7gUJw
   - Copy (as), move (as), delete, archive, link selection
   - Dir updates, notification on cp, mv, rm completion
   - Copy file paths to system clipboard on select
-  - Create (with parents), rename, duplicate (anywhere) files and dirs
-  - Launch GUI apps, run commands, spawn a shell, toggle executable
+  - Create (with parents), rename, duplicate files and dirs
+  - Launch apps, run commands, spawn a shell, toggle exe
   - Hovered file set as `$nnn` at prompt and spawned shell
   - Lock terminal after configurable idle timeout
   - Basic support for screen readers and braille displays
index f8c03cf252827a07f9dafd879ea1aafda230409c..975fe725eb6c13c2c78b6cc7d779e4a51e96453a 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -491,7 +491,7 @@ static char * const utils[] = {
 };
 
 /* Common strings */
-#define MSG_NO_TRAVERSAL 0
+#define MSG_0_ENTRIES 0
 #define MSG_INVALID_KEY 1
 #define STR_TMPFILE 2
 #define MSG_0_SELECTED 3
@@ -510,7 +510,7 @@ static char * const utils[] = {
 #define MSG_HOSTNAME 16
 #define MSG_ARCHIVE_NAME 17
 #define MSG_OPEN_WITH 18
-#define MSG_REL_PATH 19
+#define MSG_NEW_PATH 19
 #define MSG_LINK_PREFIX 20
 #define MSG_COPY_NAME 21
 #define MSG_CONTINUE 22
@@ -534,13 +534,12 @@ static char * const utils[] = {
 #define MSG_RM_TMP 40
 #define MSG_NOCHNAGE 41
 #define MSG_CANCEL 42
-#define MSG_0_ENTRIES 43
 #ifndef DIR_LIMITED_SELECTION
-#define MSG_DIR_CHANGED 44 /* Must be the last entry */
+#define MSG_DIR_CHANGED 43 /* Must be the last entry */
 #endif
 
 static const char * const messages[] = {
-       "no traversal",
+       "0 entries",
        "invalid key",
        "/.nnnXXXXXX",
        "0 selected",
@@ -557,11 +556,11 @@ static const char * const messages[] = {
        "'s'ave / 'l'oad / 'r'estore?",
        "Quit all contexts?",
        "remote name ('-' for hovered): ",
-       "archive name: ",
+       "archive [path/]name: ",
        "open with: ",
-       "relative path: ",
+       "[path/]name: ",
        "link prefix [@ for none]: ",
-       "copy name: ",
+       "copy [path/]name: ",
        "\n'Enter' to continue",
        "open failed",
        "dir inaccessible",
@@ -583,7 +582,6 @@ static const char * const messages[] = {
        "remove tmp file?",
        "unchanged",
        "cancelled",
-       "0 entries",
 #ifndef DIR_LIMITED_SELECTION
        "dir changed, range sel off", /* Must be the last entry */
 #endif
@@ -6484,7 +6482,7 @@ nochange:
                        case SEL_NEW:
                                r = get_input(messages[MSG_NEW_OPTS]);
                                if (r == 'f' || r == 'd')
-                                       tmp = xreadline(NULL, messages[MSG_REL_PATH]);
+                                       tmp = xreadline(NULL, messages[MSG_NEW_PATH]);
                                else if (r == 's' || r == 'h')
                                        tmp = xreadline(NULL, messages[MSG_LINK_PREFIX]);
                                else
@@ -6498,13 +6496,6 @@ nochange:
                        if (!tmp || !*tmp)
                                break;
 
-                       /* Allow only relative, same dir paths */
-                       if (tmp[0] == '/'
-                           || ((r != 'f' && r != 'd') && (xstrcmp(xbasename(tmp), tmp) != 0))) {
-                               printwait(messages[MSG_NO_TRAVERSAL], &presel);
-                               goto nochange;
-                       }
-
                        switch (sel) {
                        case SEL_ARCHIVE:
                                if (r == 'c' && strcmp(tmp, pdents[cur].name) == 0)