things on the minibar are distracting
Benno Schulenberg <[email protected]> Sat, 23 Jan 2021 13:25:26 +0100
| Newsgroups | gmane.editors.nano.general,gmane.editors.nano.devel |
|---|---|
| Message-ID | <[email protected]> |
[Sending this to the devel list, as these are design questions, not how-to questions.] Op 23-01-2021 om 00:20 schreef Seb: >> ? Option 'set minibar' makes nano suppress the title bar and instead >> show a bar with basic editing information at the bottom: file name >> (plus an asterisk when the buffer is modified), the cursor position >> (line,column), the character under the cursor (U+xxxx), the flags >> that --stateflags normally shows, plus the percentage of the buffer >> that is above the cursor. > > I like the idea of having three more lines of the file displayed on the screen. Well, it displays just one more line of the file: there where the title bar was. (Unless you were a user of --emptyline, then it gives two extra lines.) > I'm not sure about some details though: > > * Does this line really have to be at the bottom of the file? When I type, I use > mostly the bottom half of the screen, thus the "minibar" line is more distracting > to me at the bottom of the screen than at the top. If the minibar would be placed at the top of the screen, then also the status bar and the prompt bar would have to be there, otherwise we wouldn't gain an extra line. But the thought of having status messages like "Not found" at the top is horrible. And the thought of having a prompt there is even worse. Also, the "line,column", the character code, and the percentage are kind of feedback things, so to me it makes the most sense to show them at the bottom, where normally the status bar is. (Also, if all bars were at the top, what do we do with the help lines? They would have to be suppressed entirely, because having them at the top is too ugly, and having them at the bottom while the status bar is a the top would majorly complicate the code -- I don't want to go there.) > * The counter of chars on this line changes every time I type a letter > (obviously), It is not a character counter, but indicates the current column of the cursor. With zero-width and double-width characters, the number of characters to the left of the cursor can be larger or smaller than the column number. > thus it "flashes" and it distracts me from what I'm typing. The > information "line count,char count" is already available with ^C, does it really > need to be available at all times? ^C gives /far/ too much information. All the needless info shown by ^C is one of the two reasons that made me make --minibar. From among all that info all I want is the column number of the cursor. The line number is there only to let it make sense. > * Idem for the Unicode code, it flashes and seems rarely useful. It is rarely useful, but it is the other reason why I made --minibar: sometimes I come across invalid bytes and I want to see what code they are. Having to select the fragment, write it out to a file, exit from nano, xxd the little file, and then restart nano was a nuisance. Having this info the whole time in the bottom bar may be a distraction to you, but fifteen years of using nano has made me ignore whatever is on the bottom row -- unless I hear a beep or invoke a prompt. I see things on that row only when I directly look at it. > To go even further along the "minibar" idea: would it be possible to let this > line disappear completely with a keyboard toggle, perhaps ^C? (You probably mean M-C, as the --minibar option turns M-C into a no-op.) Hmm... That would be an idea. It would not give another extra line of editing space, though, because that bottom line needs to stay reserved for status messages and prompt bar. But... see attached patch for a rough first implementation. >> ? Option 'set markmatch' highlights the result of a successful search >> by putting the mark at the end of the match, making the match more >> visible. It also suppresses the cursor until the next keystroke. >> (If you dislike the hiding of the cursor, use 'set showcursor'.) > > I love it already. I like the improved visibility of the found occurrence, but having it marked is a bit of a hindrance. Apparently, after having searched for something, I often want to delete the relevant line, but now the first ^K deletes the found text. It needs a second ^K to delete the line. I still haven't gotten used to this. Benno
make-M-C-suppress-the-minibar.patch
(text/x-patch, 1.1 KB)
diff --git a/src/nano.c b/src/nano.c
index da195ed1..66c46f35 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -2278,6 +2278,9 @@ int main(int argc, char **argv)
#endif
#ifndef NANO_TINY
+ if (ISSET(MINIBAR))
+ SET(CONSTANT_SHOW);
+
/* If matchbrackets wasn't specified, set its default value. */
if (matchbrackets == NULL)
matchbrackets = copy_of("(<[{)>]}");
diff --git a/src/winio.c b/src/winio.c
index 66c96344..7fbeb118 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -185,7 +185,7 @@ void read_keys_from(WINDOW *win)
curs_set(1);
#ifndef NANO_TINY
- if (currmenu == MMAIN && ISSET(MINIBAR) && lastmessage > HUSH &&
+ if (currmenu == MMAIN && ISSET(MINIBAR) && ISSET(CONSTANT_SHOW) && lastmessage > HUSH &&
lastmessage != INFO && lastmessage < ALERT) {
timed = TRUE;
halfdelay(8);
@@ -2080,6 +2080,12 @@ void minibar(void)
wchar_t widecode;
#endif
+ if (!ISSET(CONSTANT_SHOW)) {
+ blank_statusbar();
+ wrefresh(bottomwin);
+ return;
+ }
+
/* Draw a colored bar over the full width of the screen. */
wattron(bottomwin, interface_color_pair[TITLE_BAR]);
mvwprintw(bottomwin, 0, 0, "%*s", COLS, " ");
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEv9AJBh5TUFKtDfIVDSjU0qCs6IQFAmAMFb4ACgkQDSjU0qCs 6IR0hA//R710BTuZ41tw4uS0iEbje72aJa/YLwUnst0Li83DWM1Ujedt37R0oMfX OyFhdsYpsu3MIb1lkbQWmpQPj2rYfC0iELGAY4TB74hOFOT5bgGJmDf0UhcW3CHT K7jrX4vcXE+J3JEz6DkV5/dDbRI5ida1gkj+DC8Tlnp+pDuBeS4NvVY0/VG0Pris 5oVWRY9s0v3gqsHIeTRZNU5LX4tT+pOvglWBQB1MGCWwVlt6XQXBQWrFMg9Eywpg Ulv+/JAv9N+ralhzUq8z5TNW8ftAJra/MVnXS3/488sx8YAzQkLsvCsAAN757wQ8 AkBQKA3nj72ZAufcjfeTSOjRRkj+7BQqSWhB7WLdLrUMo5ssvQyALbCM48bV8che 68i2oV6qh4sHL3+dfGq+sS2rYNm6dExB94KOq87+1z17RN72t+NX7iULDUcXxxj3 r0zseABoBX1VIkJvCYIVe/Y1maAcCIK58MAT3z3mk6iOpz50s785+DpdhSMIbAku DW2IWGsOeUygfeDG8pPmOpA+ZmSsl7AudTFyjuvuALFsZc1L9ycBC5fFDYr4Y50Q NuCVdzvLRV8twHFGX9oKjvNwUYP56y+iYwbPLDe8mTpp2Nc1AY/rbJSLeO/F47P9 Ip7ykSQmcBVQ1MawgbPiy8szCh165jdPgU1Ut1kv9nDGH30Pa08= =d7Fj -----END PGP SIGNATURE-----