When making a forward movement larger than a screenful, we cannot rely
on the multidata of the line before the new screen start to have been
set correctly by a previous screen drawing, so we need to recompute all
of the multidata, for the whole buffer, so that afterward we can freely
move around and draw the screen without having to do any backtracking.
Also when a piece of text larger than a screenful is pasted or inserted,
all the multidata needs to be recomputed.
This fixes https://savannah.gnu.org/bugs/?60041,
and fixes https://savannah.gnu.org/bugs/?62056.
First bug existed in this form since version 2.4.2, commit d49c267f
(but editing Python was incomparably slower in those days).
Second bug existed since version 5.6, commit 43d94692.
This does not waste time looking for an end match, which is especially
wasteful when there is none. Also, it makes the coloring behavior more
consistent: any start match will cause coloring of the subsequent text,
no matter whether the user is in the middle of the file or near the end.
As it's possible for the start regex to match what is actually the end
match of a multiline thing (see the Python triple quotes, for example),
make sure that such a detected start match is *not* an end match, just
to avoid a needless full-screen refresh.
By passing --disable-maintainer-mode to ./configure the user can disable
autoconf build rules that would cause configure to be rebuilt and rerun.
Kind-of-requested-by: Mike Frysinger <vapier@gentoo.org>
This makes nano conform to the https://no-color.org/ idea: suppressing
any color in the output (in the default setup) when NO_COLOR is set in
the environment.
Specifying a color for any interface element will, however, re-enable
also yellow for the spotlight and red for error messages.
This mitigates https://savannah.gnu.org/bugs/?36864.
Reported-by: Clarence Risher <sparr0@gmail.com>
Problem has existed since the beginning, as nano empties the existing
file before writing the current buffer contents into it.
Fix building with x86_64-w64-mingw32 to cross-compile native Windows
programs. Need to:
* add checks for missing functions
* don't use signals that are unavailable on the platform
* avoid useless non-Linux sys/ioctl.h include
* use putenv instead of setenv as the latter is unavailable
That is, take into account that the cutbuffer could be NULL
(when updating the undo item).
This fixes https://savannah.gnu.org/bugs/?62107.
Bug existed since version 4.9, commit b15c5a7e.
The 'endmatch.rm_eo' value is relative to the end of the start match,
so to find the end of the end match, one has to add 'startmatch.rm_eo'
plus 'endmatch.rm_eo' to the starting point of the line.
This addresses https://savannah.gnu.org/bugs/?62091.
Problem existed since version 5.6, commit 0596b875.
In version 2.2.0, pyflakes changed its output format,
from 'filename:line: text' to 'filename:line:column text'.
This fixes https://savannah.gnu.org/bugs/?62057.
Problem existed since version 2.9.0, commit 5dcf375f.
(That commit tried to compensate for an introductory message from gcc
that no longer seems to exist.)
The new name 'gauge' more clearly indicates that it is a distance
between two "columns", two "pillars", two "piles". Using 'longest'
was poor, because in fact it was set to 'widest + 10'.
(Also, change the type of 'piles' to an integer -- it will always
be smaller than COLS, and COLS is an integer.)
A newer compiler (gcc-10.3) said: browser.c:174:34: warning:
field width specifier '*' expects argument of type 'int'
It's fine for 'longest' to be an integer, as a filename in Unix is
at most 255 bytes long, which can occupy at most 510 columns (when
the name consists entirely of control codes), and that fits easily
within an 'int', which has at least fifteen bits, unsigned.
Well... in theory 'tabsize' could be set to an insanely high number,
and if a filename contains several tabs, this could cause 'longest'
to overflow. (Why doesn't the compiler warn about that?) If that
were to occur, and the filename with the tabs were the last in the
list, then 'longest' would get set to the minimum width: 15. That
would not be correct, but... nothing bad would happen.
This addresses https://savannah.gnu.org/bugs/?62014.
Reported-by: Mike Frysinger <vapier@gentoo.org>
This wipe suppression is meant to prevent the last row of the edit window
getting cleared when edit window and bottom window overlap, and this is
relevant only when the user is actually editing -- the file browser and
help viewer take care not to use this bottom row for content.
This fixes https://savannah.gnu.org/bugs/?62031.
Bug existed since version 6.0, commit be61aad9.
Problem existed since commit 3b657a26 from five days ago.
In addition, exclude pasting-at-the-prompt from the tiny version, as
it's hardly useful when one cannot copy a selected piece of text.
When re-entering curses mode, ncurses will pick up the new size of
the terminal and set the LINES and COLS variables appropriately.
(We don't ask the terminal for its size when nano starts up, so why
would we need to do it when the terminal is resized?)
Since version 2.8.7 the user can paste text at the prompt (with ^U),
but the ability to copy what is present at the prompt was overlooked.
For feedback, the cursor is moved to the start of the answer -- like
it moves to the start of the next line when in the edit buffer.
This addresses https://savannah.gnu.org/bugs/?61702.
Reported-by: Tasos Papastylianou <tpapastylianou@hotmail.com>
In most cases, the cursor will be at the end of what the user typed
at the prompt (or retrieved from history), and ^K will work as it
always did, erasing the whole answer. But if the user has moved the
cursor to somewhere in the middle of the answer, a ^K will now erase
just the part after the cursor. A second ^K will erase the rest.
Inspired-by: Tasos Papastylianou <tpapastylianou@hotmail.com>
Because doing the spotlighting after those extra keycodes have been
handled will most likely spotlight the wrong piece of text. Also,
if those keycodes hadn't arrived early, the first of them would have
cancelled the spotlighting.
This fixes https://savannah.gnu.org/bugs/?61962.
Bug existed since version 5.8, commit 3f340836.
When a large piece of text was pasted into nano, then the old way of
repeatedly moving the buffered text one more position toward the head
of the keystroke buffer would waste a lot of time. With this change,
pasting the current NEWS file into a buffer goes down (on my machine)
from around 30 seconds to just 2.
This addresses https://savannah.gnu.org/bugs/?61822.
Reported-by: Radu Caragea <rcaragea@protonmail.com>
Problem existed in this form since version 1.3.6, commit 7483571f.