Commit Graph

9866 Commits

Author SHA1 Message Date
Benno Schulenberg
90946c5e9e syntax: nanorc: avoid colorizing #rgb codes as if they were comments
Demand that trailing comments (which are not really supported anyway)
have a space or tab after their hash mark.
2021-11-23 12:02:03 +01:00
Brad Town
9a778f9a00 docs: add a description of the hexadecimal #rgb color specification
Also, update the syntax to colorize these codes the same as color names.

Signed-off-by: Brad Town <brad@bradtown.com>
2021-11-23 11:56:06 +01:00
Brad Town
8d6b468cdc rcfile: support #rgb format for specifying colors in 256-color terminals
Most terminal emulators support a palette of 216 indexed colors:
the 6x6x6 color cube pioneered by Xterm.  But as an index gives
little indication about what kind of color it produces, allow the
user to specify the color with three hex digits instead, one for
the level of red, green, and blue each, in the format #rgb.

One hex digit allows for sixteen values, but as there are only
six levels available, only 0, 4, 8, a, c, and e are significant
-- other values get reduced to the nearest lower one.

This fulfills https://savannah.gnu.org/bugs/?56445.
Requested-by: Peter Liscovius, Erik Lundin, Owen Maresh, Dave Lemonby

Signed-off-by: Brad Town <brad@bradtown.com>
2021-11-23 11:56:06 +01:00
Benno Schulenberg
0941185fcf tweaks: on one-row terminals, suppress the message for two toggles
Their effect is feedback enough.
2021-11-23 10:16:54 +01:00
Benno Schulenberg
8850015822 feedback: give a more accurate message when the help lines won't appear 2021-11-23 10:14:25 +01:00
Benno Schulenberg
3be4ea0dc1 tweaks: fold a special case into the general one 2021-11-23 10:10:23 +01:00
Benno Schulenberg
3eda0135bc tweaks: replace two direct refreshes with two scheduled ones
These direct calls were installed last year in commits 7303f0c7 and
b368faf1, but were made redundant by commit b741b1c9 one week later.
2021-11-22 16:41:33 +01:00
Benno Schulenberg
9c9de85afb tweaks: elide a variable that is confusing and has just one use case 2021-11-22 12:03:28 +01:00
Benno Schulenberg
addac49465 tweaks: reshuffle some conditions, to have more balanced lines 2021-11-22 11:13:02 +01:00
Benno Schulenberg
839d29be3f feedback: with --zero, drop a message in a short while, as with --minibar
Only requested information (^C, M-D) and alerts stay onscreen until the
next keystroke, but less important messages are overwritten after 1.5
seconds (or 0.8 seconds with --quick).  This makes the behavior more
consistent with dropping a message when there is a spotlighted match.
2021-11-22 11:00:11 +01:00
Benno Schulenberg
b2f0721b69 tweaks: drop a fragment of code that became functionless
This fragment suppressed the cursor when it was on the bottom row of
the terminal and a message was displayed on the status bar.  But since
commit a2a00577 from eight days ago, the cursor will be scrolled off
of the bottom row when there is a message.
2021-11-22 10:53:56 +01:00
Benno Schulenberg
b228c9fe6c tweaks: untangle two case items, and shorten a message
Also, sort the case items in the order they are listed in the help text.
2021-11-21 17:00:41 +01:00
Benno Schulenberg
8e7738e22e tweaks: adjust two values -- help lines need at least 6 rows to be shown
Commit 931bf96c from four days ago incremented the minimum height.
2021-11-21 16:52:13 +01:00
Benno Schulenberg
84f8445b7b tweaks: reshuffle some conditions, so that the ifs have similar formats 2021-11-21 11:34:42 +01:00
Benno Schulenberg
5cf412320d feedback: with --mini/--zero, suppress message when toggling whitespace
The whitespace becoming visible/invisible is feedback enough.
2021-11-21 11:24:09 +01:00
Benno Schulenberg
c9fb1cf85a tweaks: don't redraw the help lines (if present), and normalize a brace 2021-11-21 11:05:59 +01:00
Benno Schulenberg
bbed065fa8 tweaks: avoid redrawing the entire window when just a 'touch' will do 2021-11-21 10:47:44 +01:00
Benno Schulenberg
dde74dee78 docs: say thanks to the Indonesian translator 2021-11-20 16:48:28 +01:00
Benno Schulenberg
966da68228 tweaks: exclude some hidden-interface code from the tiny version
Also, reshuffle one call and drop another: the cursor has been placed
fifteen lines earlier (either directly or in edit_refresh()).

(Important test case: toggling softwrap.)
2021-11-20 16:48:28 +01:00
Benno Schulenberg
f147131e7c tweaks: elevate two messages, so they get shown with --mini or --zero
A file being in DOS or Mac format is unusual, and thus noteworthy.
2021-11-20 16:46:18 +01:00
Benno Schulenberg
7785c3f7cf feedback: with --mini or --zero, suppress number of lines for new buffer
For consistency of style, the number of lines read should only be shown
when inserting a file into the current buffer, not when reading it into
a new buffer.

This amends the fix for https://savannah.gnu.org/bugs/?61509.
2021-11-20 12:31:23 +01:00
Benno Schulenberg
9d3d354bd4 feedback: report the number of inserted lines also with --zero or --mini
Inserting another file is somewhat unusual -- it's better to give
feedback about it.

This fixes https://savannah.gnu.org/bugs/?61509.

Bug existed since version 5.5, since the minibar was introduced.
2021-11-19 17:06:56 +01:00
Benno Schulenberg
51a5f33b5b feedback: suppress chatty messages when --zero is active
Things like "Cancelled" and "Undid addition" are not needed.  They
are nice for discovery, but become distracting once you know nano.

This fixes https://savannah.gnu.org/bugs/?61508.

Bug existed since commit 03637030 from last week.
2021-11-19 16:17:55 +01:00
Benno Schulenberg
8aea8625be replacing: keep the spotlighted occurrence in view, also with --zero
Also when adjusting the viewport, after the cursor has gone offscreen
(by toggling the help lines, for example), should the SHIM be applied.

This fixes https://savannah.gnu.org/bugs/?61503.

Bug existed since commit 03637030 from last week.
2021-11-18 12:32:47 +01:00
Benno Schulenberg
931bf96c1d display: make sure there are at least as many text lines as help lines
It's an editor -- the largest element should be the text to be edited,
not some part of the interface.

(It would be better if the edit window was always the largest element,
larger than or equal to all interface elements combined.  But that is
something for another time.)
2021-11-17 17:09:29 +01:00
Benno Schulenberg
956a1c2327 help: remove an unneeded restriction for small terminals
There is no need to prevent NO_HELP from being unset on terminals
with fewer than five rows, because the bottombars() routine already
automatically suppresses the help lines on such terminals.

This improves the fix for https://savannah.gnu.org/bugs/?61497.

(The problem with absent feedback is still there when the terminal
has just one row.)
2021-11-17 16:57:50 +01:00
Benno Schulenberg
4f15890105 help: when done, always redraw the "bottom bars", also with --zero
This fixes https://savannah.gnu.org/bugs/?61500.

Bug existed since commit 3dfd798d from earlier today.
2021-11-17 16:38:30 +01:00
Benno Schulenberg
0afe38d81a help: skip the leading blank line when the terminal is very flat
On very flat terminals, a leading blank line could lead to ^G showing
just a blank row instead of the first line of the help text.
2021-11-17 12:21:41 +01:00
Benno Schulenberg
3dfd798d51 feedback: to have a status bar, suppress --zero while in the help viewer
This partially fixes https://savannah.gnu.org/bugs/?61497.

(It is not fixed for when the terminal has less than five rows.)

Bug existed since commit 03637030 from last week.
2021-11-17 12:12:27 +01:00
Benno Schulenberg
1235a5a365 tweaks: reshuffle the flag conversion into their order in the help text
This should make it slightly easier for translators when they compare
their PO file to nano's main help text.

Also, drop a die() -- a forgotten toggle name is not worth dying over.
2021-11-17 11:11:05 +01:00
Benno Schulenberg
c772e1cb6b tweaks: rename a function, away from using an abbreviation
Also reshuffle a tiny fragment of code.
2021-11-17 11:01:37 +01:00
Benno Schulenberg
e35b6636ab tweaks: reshuffle a line and adjust indentation after previous change 2021-11-17 10:49:27 +01:00
Benno Schulenberg
bd4eed9cb1 tweaks: reshuffle a fragment of code to a better place 2021-11-17 10:42:21 +01:00
Benno Schulenberg
2b0bcc7cee feedback: show a relevant message for M-O when the syntax has 'tabgives'
When the syntax contains a 'tabgives' command, toggling the conversion
of tabs-to-spaces has no effect -- not for the current file.  So, tell
the user that and don't change the flag.

This fixes https://savannah.gnu.org/bugs/?61496.

Bug existed since version 4.5, since 'tabgives' was introduced.
2021-11-17 10:25:32 +01:00
Benno Schulenberg
3b5f650621 tweaks: use a color closer to the rest of the string, to reduce contrast
On my normal machine, 'peach' harmonizes nicely with 'brightgreen',
but on another there is a large, jarring contrast.
2021-11-16 16:32:47 +01:00
Benno Schulenberg
b66a040828 tweaks: shorten the description of --zero in the manuals a bit 2021-11-16 16:23:23 +01:00
Benno Schulenberg
f757c4a512 syntaxes: colorize hex more strictly by using character class [:xdigit:]
In UTF-8 locales, the ranges A-F and a-f include several accented
characters beyond "ABCDEF" and "abcdef", such as the Croat č and ć.

This fixes https://savannah.gnu.org/bugs/?61487.

Bug existed since the beginning of each of the syntaxes,
for the C syntax since version 1.3.6, commit 159bdfdc.
2021-11-15 16:17:31 +01:00
Benno Schulenberg
06ad77895f syntax: python: colorize backslash escapes, such as \n and \xef
Reference: https://docs.python.org/3/reference/lexical_analysis.html
2021-11-15 15:30:21 +01:00
Benno Schulenberg
2cbd4d29a0 search: with --zero, drop a message at the same time as the spotlight
Messages like "Search Wrapped" and "This is the only occurrence"
do not need to be shown until the next keystroke.  Dropping them
quickly gives a better fullscreen experience.
2021-11-15 15:10:20 +01:00
Benno Schulenberg
d93a5594cd tabbing: also with --zero, stay one row away from the prompt bar
When <Tab> at a prompt shows a list of filenames, this list should
not "sit" on the prompt bar but float one row above it.

This addresses the third issue mentioned in commit 03637030.
2021-11-15 10:44:06 +01:00
Benno Schulenberg
a2a00577cd search: with --zero, do not obscure an occurrence on the bottom row
If there is a status-bar message and the cursor happens to be on the
bottom row of the screen (in hidden-interface mode), then scroll the
viewport one row down, to keep the cursor in view.

This addresses the second issue mentioned in commit 03637030.

(The issue was rereported in https://savannah.gnu.org/bugs/?61464.)
2021-11-15 10:44:06 +01:00
Benno Schulenberg
b92b9e5cac browser: with --zero, do not use the bottom row for displaying filenames
Otherwise the prompt bar or status bar could hide the highlighted item.

This addresses the first issue mentioned in commit 03637030.
2021-11-15 10:44:06 +01:00
Benno Schulenberg
d19842ed73 tweaks: add an auxiliary variable, to prepare for handling --zero 2021-11-15 10:44:06 +01:00
Benno Schulenberg
0655c8aa6c tweaks: rename a variable, to be distinctive and less confusing
Also rewrap three lines, to keep related things closer together.
2021-11-15 10:44:06 +01:00
Benno Schulenberg
30595dd2bb tweaks: frob a couple of comments, and drop two, for conciseness 2021-11-15 10:44:06 +01:00
Benno Schulenberg
b76b5b9967 tweaks: use a few fewer capitals, and drop an unneeded synonym 2021-11-13 16:33:47 +01:00
Benno Schulenberg
1007ca5af8 docs: mention M-Z (for toggling the interface) among the Feature Toggles
And rephrase the M-Y description a bit, for shortness and variety.
2021-11-13 16:30:38 +01:00
Benno Schulenberg
f3fab1440f tweaks: shorten two comments, and fold two statements together 2021-11-11 16:06:43 +01:00
Benno Schulenberg
affca9b523 statusbar: overwrite a message also when using --constant with --zero
This needlessly wipes the status bar when --constantshow is active,
but it already needlessly wiped it when --minibar is active, so...
It is not a performance issue.  It was just a small optimization.
(Plus, with --zero, nano does a full edit_refresh() when in fact
only the bottom row needs to be redrawn, but there is no easy way
to do that when --softwrap is active, so...)

(Using --constantshow with --zero doesn't make sense, but the user
might want to have the --constantshow when they toggle --zero off.)
2021-11-11 16:02:58 +01:00
Benno Schulenberg
2f53760689 bindings: let ^T in the tiny version invoke spell checker (when included)
This fixes https://savannah.gnu.org/bugs/?61460.

Bug existed since version 5.0, commit d3954901, since in the normal
version ^T was repurposed to give direct access to the Execute menu.
2021-11-10 16:42:51 +01:00