Store the file sizes from before and after the commenting/uncommenting
in the undo struct, so they can be restored when undoing or redoing.
This fixes https://savannah.gnu.org/bugs/?48062.
Signed-off-by: Mike Scalora <mike@scalora.org>
This allows for commenting or uncommenting a line or a bunch of lines
with a single keystroke (default binding: M-3). The characters used
for commenting/uncommenting are specified by the active syntax file.
Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Mike Scalora <mike@scalora.org>
If during startup there are multiple error messages, currently only the
last one remains and can be read. To improve on that, introduce a short
pause between error messages -- even if it's not enough to read them all,
at least the user will be aware that there are multiple ones.
This also causes a few error messages to beep that currently don't beep,
such as when a file is unwritable.
When fixing a misspelling and not answering 'All' (but 'Yes' or 'No'),
the chance is quite substantial that one will type y or n at the end of
the next word. Diminish this chance by showing for a moment a message
on the statusbar.
Partitioning the file makes the undo system lose track, so that undoing
things has a good chance of losing data. Instead, just make sure that
the region is marked "backwards", with current at the top and the mark
at the bottom, and then let the replace loop take care of not going
outside of the marked region.
This also has the effect that if the marked region fits entirely on the
screen, or all the misspellings are onscreen, then the screen will not
be scrolled at all. Which makes for a smooth experience.
This fixes https://savannah.gnu.org/bugs/?47836,
and fixes https://savannah.gnu.org/bugs/?45573.
Since nano-2.4.1, reading in or pasting a large piece of text would put
the cursor on the bottom line, leaving only one line of the non-read or
non-pasted text visible. This is different from the centering behavior
of Pico, and somewhat disorienting, as you can't see "where you are" any
more in relation to the file as it was.
So now center the cursor whenever the read or pasted text is larger than
the screen, but don't center it when the text fits entirely on the screen.
(The latter avoids the effect of the screen jumping unnecessarily when
inserting just a few lines while the cursor is near the bottom.)
To achieve this behavior: default to focusing, and temporarily set it to
FALSE when the focusing effect is unwanted.
This fixes https://savannah.gnu.org/bugs/?47841.
When starting to replace misspelled words, pass the actual position
of the cursor instead of the position of the first found occurrence,
so that the cursor position will be updated for changed lengths.
This fixes https://savannah.gnu.org/bugs/?47834.
When we're spell checking, we don't need a special mechanism to detect
we have come full circle: reaching the end-of-buffer means we're done.
So don't bother to reset came_full_circle when we're spell checking
(when begin == NULL) but simply ignore its value.
For a little contrast with the function edit_refresh() -- it's
annoying that when you search for the latter you get to see all
the settings of the flag too.
Instead of saving the current value of placewewant, then setting the
new value, and then passing the old value to edit_redraw() in seven
different places, just let edit_redraw() do this saving and setting.
In the bargain placewewant is now only recalculated when it matters
-- when allow_update is TRUE -- and not when it's superfluous.
In the innermost search loop, don't set placewewant, because this loop
is also used for replacing and spell fixing, when we don't really want
to be there: we are just passing through. Not setting placewewant means
we don't need to save and restore it in those passing-through routines.
The value of placewewant is only relevant when doing cursor movement,
which doesn't happen during replacing nor spell checking, so there is
no need to keep placewewant up to date -- it is set when it matters:
at the end of go_looking().
Add a third mode of scrolling, FLOWING, besides CENTERING and STATIONARY.
This is used for word and paragraph jumping (and for bracket matching,
but that worked correctly already), and only when focusing is FALSE.
The new mode prevents the screen from scrolling too many lines when
there are several blank lines at the bottom of the edit window and
the next word or paragraph is out of view.
This fixes https://savannah.gnu.org/bugs/?47194.
When finding a misspelled word, the length of the match is simply the
length of that word, and its span in columns is simply the number of
columns that it occupies. Compute it thus directly.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
When searching for a misspelled word takes a while, and the user
stops this search with ^C, then abort the spelling-checking session.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
that is taking too long. This fixes Savannah bug #47439.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5776 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
invalid escape sequence, and when entering a verbatim keystroke.
But leaving the cursor off during Unicode input, for extra feedback.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5771 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
deletion of words like the pressing of Backspace/Delete, so they don't
overwrite the lines you cut elsewhere and want to paste into the place
of the cut words.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5751 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
And not minding when the column number is zero or negative.
This partially fixes Savannah bug #47131.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5669 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
* Add ability to kill the trailing spaces when justifying
code. New nanorc option kill_spaces_on_wrap, we'll see
whether this warrants a command line flahg or not.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5664 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
needed), so that it no longer shows in the help screen nor in the file list.
This fixes Savannah bug #47126.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5640 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
error messages upon reentry. And, if there are any messages,
allowing the user a little time to read them.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5632 35c25a1d-7b9e-4130-9fde-d3aeb78583b8