Browse Source

vim plugin: Enter clears selection and picks cuntry

master
Arun Prakash Jana 6 years ago
parent
commit
04b0a38f68
No known key found for this signature in database GPG Key ID: A75979F35C080412
1 changed files with 12 additions and 6 deletions
  1. +12
    -6
      src/nnn.c

+ 12
- 6
src/nnn.c View File

@@ -2650,6 +2650,18 @@ nochange:
goto begin; goto begin;
case S_IFREG: case S_IFREG:
{ {
/* If opened as vim plugin and Enter/^M pressed, pick */
if (cfg.picker && sel == SEL_GOIN) {
r = mkpath(path, dents[cur].name, newpath, PATH_MAX);
/* NOTE: This overrides any previous selection */
copybufpos = 0;
appendfpath(newpath, r);
writecp(newpath, r - 1);

dentfree(dents);
return;
}

/* If open file is disabled on right arrow or `l`, return */ /* If open file is disabled on right arrow or `l`, return */
if (cfg.nonavopen && sel == SEL_NAV_IN) if (cfg.nonavopen && sel == SEL_NAV_IN)
continue; continue;
@@ -3426,12 +3438,6 @@ nochange:
} }
} }


if (cfg.picker && copybufpos == 0 && ndents) {
r = mkpath(path, dents[cur].name, newpath, PATH_MAX);
appendfpath(newpath, r);
writecp(newpath, r - 1);
}

dentfree(dents); dentfree(dents);
return; return;
} /* switch (sel) */ } /* switch (sel) */


Loading…
Cancel
Save