mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 13:51:31 +00:00
vim plugin: Enter clears selection and picks cuntry
This commit is contained in:
parent
91901b4f30
commit
04b0a38f68
18
src/nnn.c
18
src/nnn.c
|
@ -2650,6 +2650,18 @@ nochange:
|
|||
goto begin;
|
||||
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 (cfg.nonavopen && sel == SEL_NAV_IN)
|
||||
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);
|
||||
return;
|
||||
} /* switch (sel) */
|
||||
|
|
Loading…
Reference in a new issue