When an operation that replaces the entire buffer is undone, the
position of the viewport is lost. Compensate for this by storing
the row of the cursor in the undo item, and, after executing the
undo item, arranging the viewport so that the cursor is back on
the original row -- the row where the operation was invoked.
This fixes https://savannah.gnu.org/bugs/?57039.
For the three operations (justification, spell checking, and filtering)
that need to undo or redo two suboperations (cutting and then pasting)
in one go, pass the message that describes the operation to add_undo(),
so that the undo item does not need to be modified after the call.
This looks better, but does add some twenty NULL parameters elsewhere.
When 'extendsyntax' is used with a 'header' or 'magic' command, it
must be processed immediately. It is pointless to store the command,
because when then it is processed (when the syntax gets used), it is
too late to have any effect.
This fixes https://savannah.gnu.org/bugs/?56997.
With-help-from: Brand Huntsman <alpha@qzx.com>
Bug existed since version 4.3, commit cba9d8d0.
Instead of marking the buffer as modified, provide the feedback that
"nothing was cut", like when trying to chop a word rightward at the
end of the buffer.
This fixes https://savannah.gnu.org/bugs/?57015.
Bug existed since version 4.4, commit 4314b8de.
For historical reasons the rebinding code allows binding F13...F16,
which on most terminals are typable with Shift plus F1...F4. But,
at least on an Xfce Terminal, Shift plus F1...F12 produce F13...F24.
On a Linux console, Shift plus F1...F8 produce F13...F20. So: allow
to bind the full shifted F13...F24 range. It costs no extra code
and makes things more rounded.
Also say that rebinding ^H is sometimes impossible, or when it's
made possible, that it rebinds the Backspace key too.
This addresses https://savannah.gnu.org/bugs/?56994.
Reported-by: Tiago Almeida <tjamadeira@gmail.com>
For extensionless files, recognize C/C++ ones from the mode name
between the -*- marks on the first line.
This addresses https://savannah.gnu.org/patch/?9719.
Inspired-by: Devin Hussey <husseydevin@gmail.com>
Hard-binding the ^H control code prevents the user from rebinding
the keystroke.
This fixes https://savannah.gnu.org/bugs/?56995.
Bug existed since version 4.0, commit 72a49dbb.
In a non-UTF8 build, mbwidth() returns always 1, so it is pointless
to call that function and compare its result to zero then.
Also, don't bother special-casing the function for a non-UTF8 locale.
When there are fewer than four menu items, act as if there are four:
make their clickable width half the width of the screen.
Until now, when there were two menu items, their clickable width would
be the full width of the screen, which was overwide. But when there
was just one menu item, its clickable width would suddenly be as small
as when the menu had the maximum number of items (12 for an 80-column
screen). This was odd.
Also, slightly simplify another computation.