diff options
author | 2020-02-17 23:21:46 +0100 | |
---|---|---|
committer | 2020-02-18 03:51:46 +0530 | |
commit | 75f6d5d735ea50112aa9ba02864fda83da8def41 (patch) | |
tree | a711e0e596f6ca61b85a454afdb6a00865addfba /src | |
parent | 9cf77708a1e1d9ec94afacd68847dcb6e98e1c27 (diff) | |
download | nnn-75f6d5d735ea50112aa9ba02864fda83da8def41.tar.gz |
Avoid trying to edit a non-existing file (#477)
The previous implementation was inconsistent, sometimes it would
inherit the name of the parent folder of the current directory.
Other scenarios i encountered were:
1. Yield a empty search result, and try to edit. It would seemingly
randomly select a file or folder
2. What would happen in a root path without any files residing?
Diffstat (limited to 'src')
-rw-r--r-- | src/nnn.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -5453,6 +5453,8 @@ nochange: if (ndents) mkpath(path, dents[cur].name, newpath); + else if (sel == SEL_EDIT) /* Avoid trying to edit a non-existing file */ + goto nochange; switch (sel) { case SEL_REDRAW: |