소스 검색

Don't remember initial dir per-context

master
Arun Prakash Jana 6 년 전
부모
커밋
0522a426c0
No known key found for this signature in database GPG 키 ID: A75979F35C080412
3개의 변경된 파일2개의 추가작업 그리고 7개의 파일을 삭제
  1. +1
    -1
      README.md
  2. +1
    -1
      nnn.1
  3. +0
    -5
      src/nnn.c

+ 1
- 1
README.md 파일 보기

@@ -299,7 +299,7 @@ Contexts serve the purpose of exploring multiple directories simultaneously. 4 c


To switch to a context press the Leader key followed by the context number (1-4). To switch to a context press the Leader key followed by the context number (1-4).


The first time a context is entered, it copies the state of the last visited context. Each context remembers its start directory and last visited directory. The first time a context is entered, it copies the state of the last visited context. Each context remembers its last visited directory.


When a context is quit, the next active context is selected. If the last active context is quit, the program quits. When a context is quit, the next active context is selected. If the last active context is quit, the program quits.




+ 1
- 1
nnn.1 파일 보기

@@ -230,7 +230,7 @@ are available. The status of the contexts are shown in the top left corner:
.Pp .Pp
To switch to a context press the Leader key followed by the context number (1-4). To switch to a context press the Leader key followed by the context number (1-4).
.Pp .Pp
The first time a context is entered, it copies the state of the last visited context. Each context remembers its start directory and last visited directory. The first time a context is entered, it copies the state of the last visited context. Each context remembers its last visited directory.
.Pp .Pp
When a context is quit, the next active context is selected. If the last active context is quit, the program quits. When a context is quit, the next active context is selected. If the last active context is quit, the program quits.
.Sh FILTERS .Sh FILTERS


+ 0
- 5
src/nnn.c 파일 보기

@@ -302,7 +302,6 @@ typedef struct {
/* Contexts or workspaces */ /* Contexts or workspaces */
typedef struct { typedef struct {
char c_path[PATH_MAX]; /* Current dir */ char c_path[PATH_MAX]; /* Current dir */
char c_init[PATH_MAX]; /* Initial dir */
char c_last[PATH_MAX]; /* Last visited dir */ char c_last[PATH_MAX]; /* Last visited dir */
char c_name[NAME_MAX + 1]; /* Current file name */ char c_name[NAME_MAX + 1]; /* Current file name */
settings c_cfg; /* Current configuration */ settings c_cfg; /* Current configuration */
@@ -2876,7 +2875,6 @@ static void browse(char *ipath)
/* setup first context */ /* setup first context */
xstrlcpy(g_ctx[0].c_path, ipath, PATH_MAX); /* current directory */ xstrlcpy(g_ctx[0].c_path, ipath, PATH_MAX); /* current directory */
path = g_ctx[0].c_path; path = g_ctx[0].c_path;
xstrlcpy(g_ctx[0].c_init, ipath, PATH_MAX); /* start directory */
g_ctx[0].c_last[0] = g_ctx[0].c_name[0] = newpath[0] = mark[0] = '\0'; g_ctx[0].c_last[0] = g_ctx[0].c_name[0] = newpath[0] = mark[0] = '\0';
rundir[0] = runfile[0] = '\0'; rundir[0] = runfile[0] = '\0';
lastdir = g_ctx[0].c_last; /* last visited directory */ lastdir = g_ctx[0].c_last; /* last visited directory */
@@ -3201,7 +3199,6 @@ nochange:
else { /* Setup a new context from current context */ else { /* Setup a new context from current context */
g_ctx[r].c_cfg.ctxactive = 1; g_ctx[r].c_cfg.ctxactive = 1;
xstrlcpy(g_ctx[r].c_path, path, PATH_MAX); xstrlcpy(g_ctx[r].c_path, path, PATH_MAX);
xstrlcpy(g_ctx[r].c_init, path, PATH_MAX);
g_ctx[r].c_last[0] = '\0'; g_ctx[r].c_last[0] = '\0';
xstrlcpy(g_ctx[r].c_name, dents[cur].name, NAME_MAX + 1); xstrlcpy(g_ctx[r].c_name, dents[cur].name, NAME_MAX + 1);
g_ctx[r].c_cfg = cfg; g_ctx[r].c_cfg = cfg;
@@ -3210,7 +3207,6 @@ nochange:


/* Reset the pointers */ /* Reset the pointers */
path = g_ctx[r].c_path; path = g_ctx[r].c_path;
ipath = g_ctx[r].c_init;
lastdir = g_ctx[r].c_last; lastdir = g_ctx[r].c_last;
lastname = g_ctx[r].c_name; lastname = g_ctx[r].c_name;


@@ -3953,7 +3949,6 @@ nochange:


/* Switch to next active context */ /* Switch to next active context */
path = g_ctx[r].c_path; path = g_ctx[r].c_path;
ipath = g_ctx[r].c_init;
lastdir = g_ctx[r].c_last; lastdir = g_ctx[r].c_last;
lastname = g_ctx[r].c_name; lastname = g_ctx[r].c_name;
cfg = g_ctx[r].c_cfg; cfg = g_ctx[r].c_cfg;


||||||
x
 
000:0
불러오는 중...
취소
저장