When the WAS_FINAL_LINE flag is relevant (when NO_NEWLINES isn't set),
the only way for 'current' to be equal to 'filebot' is when 'current_x'
is zero.
When some or all edits have been undone, and the user starts to make
new edits, the old part of the undo stack is discarded, but this does
not mean that the undo stack doesn't go back to the very beginning.
This really fixes https://savannah.gnu.org/bugs/?52504.
This also means that no question needs to be asked when exiting.
This fixes https://savannah.gnu.org/bugs/?52504.
Reported-by: Peter Passchier <peter@passchier.net>
On a freshly installed system, or for a new user, the default
XDG data directory may not exist yet. So, create it when not.
Reported-by: Brand Huntsman <alpha@qzx.com>
The softmark is now only cancelled when the cursor is moved without
Shift being held, not for things like ^L (Refresh), ^C (Position),
or ^G (Help).
This addresses https://savannah.gnu.org/bugs/?52470.
When a file is closed with the cursor on line 1, column 1, this
position is not recorded in file-positions history file -- if a
record for the file existed, it is deleted. In the latter case
the history file needs to be saved, so that other instances of
nano will know about the deletion.
This fixes https://savannah.gnu.org/bugs/?52505.
The pointer not being NULL is enough indication that the mark is set.
Also, rename the pointer from 'mark_begin' to simply 'mark', since
the former is kind of pleonastic.
Because the highlighting hinders the display of affected lines,
and, more importantly, only the highlighted part would be written
if the file was modified and the user answers yes to the "Save?"
prompt.
This fixes https://savannah.gnu.org/bugs/?52474.
Since file-5.10 (end of 2011), libmagic identifies a C file in most
cases as "C source" instead of as "C program". Nano's magic strings
for some other files didn't match any more what file-5.32 currently
produces, either. So, they have been adjusted, new ones added, and
old ones deleted.
This fixes https://savannah.gnu.org/bugs/?52445.
Adding the obscure A_PROTECT attribute to every color prevents an
occasional miscoloring of the first few rows on the screen -- when
ncurses is version 6.0 and dates from before October 17, 2015.
Original-idea-by: Brand Huntsman <alpha@qzx.com>
Tested-by: Brand Huntsman <alpha@qzx.com>
This fixes https://savannah.gnu.org/bugs/?52182.
When there are no help lines, there won't be any call to update the
actual contents of the bottom window, so... do it immediately after
blanking the row.
This fixes https://savannah.gnu.org/bugs/?52377.
Whenever a buffer is closed, check whether the positions file on disk
was modified, and if so, reload it. Then update the position for the
closed buffer and write out the positions file to disk.
Signed-off-by: Brand Huntsman <alpha@qzx.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
The function get_key_buffer() assumes waiting_mode = TRUE, but stdin
can be in non-blocking mode when a program (before nano) turned stdin
to non-blocking mode and did not change it back (possibly because it
crashed). So, explicitly set stdin to blocking mode at startup.
Signed-off-by: Lion Yang <lion@aosc.io>