Feature request, since nothing came out of #124 except a mis-informed "you didn't read the documentation".
mis-informed
You need to go through the nnn design considerations which is linked from the README.
nnn will never have multi-tab or multi-pane because there are several utilities which do it already and we prefer to re-use the functionality. We don't have bandwidth to rebuild the wheel. If you are interested, you are welcome to raise a PR and we can review it.
i have pushed the implementation to master. Check it out.
Also if you appreciate the utility and volume of work involved please consider donating to the project.
Thanks, appreciate it. It looks good, I wrote a small patch to support up to 9 contexts, if that can help anybody else:
From bb1245f03890adbb8d04a2da6989a79b1ae6540e Mon Sep 17 00:00:00 2001
From: Frank LENORMAND <[email protected]>
Date: Thu, 8 Nov 2018 20:14:25 +0300
Subject: [PATCH] Support up to 9 contexts
---
README.md | 4 ++--
nnn.1 | 4 ++--
nnn.c | 17 +++++++++++------
3 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/README.md b/README.md
index d7e2cf0..187f9cc 100644
--- a/README.md
+++ b/README.md
@@ -261,13 +261,13 @@ Help & settings, file details, media info and archive listing are shown in the P
#### Contexts
-Contexts (aka _tabs_ aka _workspaces_) serve the purpose of exploring multiple directories simultaneously. 4 contexts are available. The status of the contexts are shown in the top left corner:
+Contexts (aka _tabs_ aka _workspaces_) serve the purpose of exploring multiple directories simultaneously. 9 contexts are available. The status of the contexts are shown in the top left corner:
- the current context is in reverse
- other used contexts are underlined
- rest are unused
-The bookmark prompt understands contexts. To switch contexts press `^B` and enter the context number (1-4).
+The bookmark prompt understands contexts. To switch contexts press `^B` and enter the context number (1-9).
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.
diff --git a/nnn.1 b/nnn.1
index 40d21d3..eee4ba3 100644
--- a/nnn.1
+++ b/nnn.1
@@ -184,7 +184,7 @@ few easy steps. Please visit the project page (linked below) for the
instructions.
.Sh CONTEXTS
Contexts (aka \fItabs\fR aka \fIworkspaces\fR) serve the purpose of exploring multiple directories
-simultaneously. 4 contexts are available. The status of the contexts are shown in the top left corner:
+simultaneously. 9 contexts are available. The status of the contexts are shown in the top left corner:
.Pp
- the current context is in reverse
.br
@@ -192,7 +192,7 @@ simultaneously. 4 contexts are available. The status of the contexts are shown i
.br
- rest are unused
.Pp
-The bookmark prompt understands contexts. To switch contexts press \fI^B\fR and enter the context number (1-4).
+The bookmark prompt understands contexts. To switch contexts press \fI^B\fR and enter the context number (1-9).
.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.
.Pp
diff --git a/nnn.c b/nnn.c
index 0e387fc..08528e7 100644
--- a/nnn.c
+++ b/nnn.c
@@ -175,7 +175,7 @@ disabledbg()
#define _ALIGNMENT_MASK 0xF
#define SYMLINK_TO_DIR 0x1
#define MAX_HOME_LEN 64
-#define MAX_CTX 4
+#define MAX_CTX 9
/* Macros to define process spawn behaviour as flags */
#define F_NONE 0x00 /* no flag set */
@@ -2329,8 +2329,8 @@ static void redraw(char *path)
DPRINTF_S("copymode off");
}
- /* Fail redraw if < than 11 columns, context info prints 10 chars */
- if (COLS < 11) {
+ /* Fail redraw if < than 21 columns, context info prints 20 chars */
+ if (COLS < 21) {
printmsg("too few columns!");
return;
}
@@ -2370,11 +2370,11 @@ static void redraw(char *path)
} else
printw("%d ", i + 1);
}
- printw("\b] "); /* 10 chars printed in total for contexts - "[1 2 3 4] " */
+ printw("\b] "); /* 20 chars printed in total for contexts - "[1 2 3 4 5 6 7 8 9] " */
attron(A_UNDERLINE);
/* No text wrapping in cwd line */
- g_buf[ncols - 11] = '\0';
+ g_buf[ncols - 21] = '\0';
printw("%s\n\n", g_buf);
attroff(A_UNDERLINE);
@@ -2743,7 +2743,12 @@ nochange:
case '1': //fallthrough
case '2': //fallthrough
case '3': //fallthrough
- case '4':
+ case '4': //fallthrough
+ case '5': //fallthrough
+ case '6': //fallthrough
+ case '7': //fallthrough
+ case '8': //fallthrough
+ case '9':
{
r = tmp[0] - '1'; /* Save the next context id */
if (g_curctx == r)
--
2.19.0
I see at least 4 glaring issues with this half-understood patch. And 9 contexts are a overkill.
You have 4 contexts, 10 bookmarks, 1 mark and you still need 5 more contexts _ if that can help anybody else_. I don't think you are even trying to understand the philosophy of nnn.
The philosphy of nnn seems to be that you will bash anybody who dares make suggestions you don't like ;)
I posted this patch for other users, not you, so just look away.
The philosphy of nnn seems to be that you will bash anybody who dares make suggestions you don't like ;)
Not exactly. It has nothing relevant to my liking (or not). There seems to be a communication gap here. I did spend quality time to work out the workspace thing you asked for. When you request for features in a utility which is maintained by someone else you should be open enough to accept rejections.
Feel free to post your patches in your gist. As the maintainer of this project I have to state it very clearly when I see a third-party patch linked here that I don't support officially.
If you must post it here, do add a disclaimer that this is not an official patch.