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.)
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.
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.)
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.
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.)
The --noread option should apply only to the files listed on the
command line, but once nano has started, it should be possible to
insert other files into the current buffer or into a new buffer.
This fixes https://savannah.gnu.org/bugs/?61458.
Bug existed since version 2.3.3, since --noread was introduced.
When the terminal has just one row, there is no room to constantly show
the position of the cursor, so do not allow the user to switch it on.
This fixes https://savannah.gnu.org/bugs/?61445.
Bug existed since version 5.8, commit 36ffb5f0.
With --zero or 'set zero', nano will hide the title bar or the minibar
(whichever is active) and will use all rows of the terminal for showing
the text of the buffer. Only when there is an important message will
it be shown on the bottom row -- until the next keystroke.
This feature can be toggled with M-Z.
The feedback at startup ("Read nnn lines") is suppressed with --zero,
because it disrupts the fullscreen experience (and is hardly useful).
The "Reading..." message then needs to be suppressed too, otherwise
it creates an annoying little flash.
There are still some issues that need to be addressed:
* In the browser, when the highlighted item is on the bottom row, it
will get obscured by the prompt bar or the "Search Wrapped" message.
* In the edit window, when the search occurrence is on the bottom row,
it can get obscured by the "This is the only occurrence" message.
* When tabbing at a prompt shows possible completions, they are shown
a row too low.
In the beginning, the goal for nano was to be a drop-in replacement for
Pico. Pico did not know a Suspend command, so the ^Z keystroke needed
to be conditionalized on an option (-z or --suspend or the toggle M-Z),
just like the ^S and ^Q keystrokes (for stopping and resuming terminal
output) were conditionalized on --preserve.
But nano has abandoned full Pico compatibility since version 4.0. It
is time to unconditionalize ^Z as well. This should not be a problem:
Debian and Ubuntu have had 'set suspend' in their /etc/nanorc for years,
so a considerable portion of nano users have had ^Z enabled by default
for a long time, and no one seems to have complained.
If the keystroke bothers some user, they can unbind it in their nanorc.
They will still be able to suspend nano through the Execute menu: ^T^Z.
This addresses https://savannah.gnu.org/bugs/?61372.
Curses cannot function if not informed via TERM which type of terminal
is being used. As many terminals are mostly compatible with a VT220,
falling back to "vt220" when TERM is unset has a good chance of giving
the user a usable nano, instead of simply failing.
(Falling back to "vt100" is not good as it contains padding delays.)
This partially addresses https://bugs.debian.org/991982.
When a segment of text is extracted, copy any anchors that it has
into the cutbuffer, so that they get saved in the undo item, so that
an undo will put these anchors back on the lines where they were,
instead of leaving an inherited anchor at the top of the segment.
And when text is pasted, clear any anchors in it, so that they will
not travel nor multiply.
This fixes https://savannah.gnu.org/bugs/?61162.
Bug existed since version 5.0, since anchors were introduced.
Any error message will already have been written to the terminal by
statusline(). Also, "Buffer not written to" looked too much like
"Buffer written to"; one had to look closely to see the difference.
Make sure that when multiple nanos with nameless buffers die,
each of them tries saving those buffers to different files.
This addresses https://savannah.gnu.org/bugs/?60902.
Reported-by: Julian Rosen <julianrosen@gmail.com>
And make the wording for the --historylog option similar.
This fixes https://savannah.gnu.org/bugs/?60868.
Bug existed since version 2.3.0, commit 8e2a9307, since the
saving and restoring of the cursor position was introduced.
When something that is called from die() calls die() again,
there is nothing we can do any more but give up.
This would have prevented the spiralling as
seen in https://savannah.gnu.org/bugs/?60853.
When it is not specified, it defaults to the value for 'titlecolor'.
When not using --minibar, I want the title bar to be blue (as that is
how I've always had it), but with --minibar, I want this mini bar to
be grey, as otherwise it reminds me too much of the prompt bar.
Also, colorize 'set minicolor' as valid in a nanorc file.
Even though I know that spotlighted text is not selected, I still
regularly think for a fleeting instant that the spotlighted text
can be cut with a ^K. Mitigate this by dropping the spotlighting
after 1.5 seconds (or 0.8 seconds when using --quick).
When using +/ or +?, any minor feedback should be cleared,
to not distract from the highligted search result.
This fixes https://savannah.gnu.org/bugs/?60669.
Bug existed since version 5.5, commit b86f7868,
since the manner of grading status-bar messages changed.