Commit Graph

9886 Commits

Author SHA1 Message Date
Benno Schulenberg
27aff84f74 syntax: nanorc: paint arguments of 'include' and 'extendsyntax' specially
The path after 'include' is not a regex and does not need to be quoted;
when it's unquoted, colorize it specially, instead of leaving it red.

The syntax name after 'extendsyntax' should be brightgreen, like after
'syntax', but it's better that the subsequent commands have their own
special color.
2021-11-29 11:18:15 +01:00
Benno Schulenberg
a43ee17ad0 docs: document the effect of --quickblank together with --zero/--minibar 2021-11-29 10:47:49 +01:00
Benno Schulenberg
abd4c47acf feedback: when reporting an unbound function key, mention its number
This makes it easier to figure out what to put in their nanorc file
when the user wants to bind the key.
2021-11-28 15:43:54 +01:00
Benno Schulenberg
b87722ab2d feedback: report an unbindable function key as an "Unknown sequence"
Saying "Unbound key" would imply that it could be bound in a nanorc.

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

Bug existed in this form since version 2.6.0, commit e0c4f9c5.
2021-11-28 12:31:36 +01:00
Benno Schulenberg
b5448615b9 display: redraw the screen in tiny version upon resuming from suspension
Letting the dummy key KEY_FRESH do a full refresh in the tiny version
allows a 'fg' to properly resume after an external SIGSTOP.

(Reminder: the ungetch() is needed in the normal version to prevent
the eating of a keystroke: https://savannah.gnu.org/bugs/?48331.)
2021-11-28 11:52:42 +01:00
Benno Schulenberg
d14d9069cd tweaks: exclude some suspension code from the tiny version
The SIGCONT handler needs to stay, so that also in the tiny version
a 'fg' can properly resume from an external SIGTSTP.
2021-11-28 11:08:37 +01:00
Benno Schulenberg
93df6ab385 tweaks: shorten a comment, and drop some conditionalizing
The conditionalizing was needed only for Slang -- see commit 009fb2fa.
2021-11-27 17:07:47 +01:00
Benno Schulenberg
be87f110ce bindings: allow rebinding ^Z also on a Linux console (a VT)
Achieve this by translating KEY_SUSPEND back to ^Z.

(Strictly speaking, this is incorrect, as the terminfo entry
might specify some other keystroke for 'kspd', but... meh.)

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

Bug existed since before version 2.2.0, since keys became rebindable.
2021-11-27 16:53:05 +01:00
Benno Schulenberg
9ebee362a5 tweaks: fix typo, and improve description of 'set zero' in sample nanorc 2021-11-27 16:52:54 +01:00
Benno Schulenberg
27928e47be docs: mention that --zero and 'set zero' hide also the help lines 2021-11-26 11:01:33 +01:00
Benno Schulenberg
79def643a3 options: make --zero imply --nohelp, and 'set zero' imply 'set nohelp'
This fits better with what "zero" intuitively means.
2021-11-26 10:58:17 +01:00
Benno Schulenberg
9a8d9ef496 tweaks: fix a somewhat humorous typo
The typo was found by hitting ^] several times on "spell" during
random testing and getting two suspiciously similar results.
2021-11-25 11:14:11 +01:00
Benno Schulenberg
7336c28ca8 display: clear the status bar early enough, so that --zero can show text
This fixes https://savannah.gnu.org/bugs/?61554.

Bug existed since commit be61aad9 from yesterday.
2021-11-25 11:08:21 +01:00
Benno Schulenberg
6a521da437 display: ensure feedback will be cleared also on a one-row terminal
This fixes https://savannah.gnu.org/bugs/?61548.

Bug existed since commit be61aad9 from earlier today.
2021-11-24 16:17:34 +01:00
Benno Schulenberg
6d828cf470 display: move some code for overwriting verbatim feedback with --zero
This code was meant to do just that.  So, put it where it's needed.

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

Bug existed since commit 511a2850 from earlier today.
2021-11-24 16:00:14 +01:00
Benno Schulenberg
511a2850a1 display: with --zero, redraw the bottom row instead of wiping a message
This fixes https://savannah.gnu.org/bugs/?61541.

Bug existed since commit 03637030 from two weeks ago.
2021-11-24 12:34:23 +01:00
Benno Schulenberg
be61aad935 display: do not wipe the status bar when --zero or --minibar is active
With --zero, any message that was there will get overwitten by the
text window anyway as result of the current operation.  And with
--minibar, any message will get overwritten with the minibar.

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

Bug existed since commit 03637030 from two weeks ago.
2021-11-24 12:03:29 +01:00
Benno Schulenberg
c06f7d43e9 tweaks: reshuffle a few lines, for Christmas and to group things better 2021-11-24 10:44:12 +01:00
Benno Schulenberg
3638fb9da4 tweaks: place the unsetting of a flag better, and rename a variable
The unsetting should happen after the three possible early returns,
to avoid leaving the flag unset.

Also, don't bother to exclude the setting and unsetting from the
tiny version, to get rid of some cluttering conditionals.
2021-11-24 10:40:05 +01:00
Benno Schulenberg
2fc1f08573 tweaks: fix a parentheses mistake -- found by a warning from Clang 2021-11-23 17:37:50 +01:00
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