瀏覽代碼

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?
master
0xACE GitHub 5 年之前
父節點
當前提交
75f6d5d735
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 2 行新增0 行删除
  1. +2
    -0
      src/nnn.c

+ 2
- 0
src/nnn.c 查看文件

@@ -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:


||||||
x
 
000:0
Loading…
取消
儲存