mirror of
git://git.sv.gnu.org/nano.git
synced 2025-03-24 18:33:03 +03:00
Not deleting the magic line, instead of removing and then re-adding it.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5262 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
parent
4310139117
commit
e219bb9dba
@ -8,6 +8,8 @@
|
|||||||
only when the specified menu name is an existing one.
|
only when the specified menu name is an existing one.
|
||||||
* doc/syntax/changelog.nanorc: Stop the changed-files colour from
|
* doc/syntax/changelog.nanorc: Stop the changed-files colour from
|
||||||
spilling beyond a blank line. Also highlight releases.
|
spilling beyond a blank line. Also highlight releases.
|
||||||
|
* src/text.c (do_deletion): Instead of deleting and then re-adding
|
||||||
|
the magic line, simply don't delete it.
|
||||||
|
|
||||||
2015-06-18 Benno Schulenberg <bensberg@justemail.net>
|
2015-06-18 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* src/rcfile.c: Allow a tiny nano's ~/.nanorc to enable search and
|
* src/rcfile.c: Allow a tiny nano's ~/.nanorc to enable search and
|
||||||
|
12
src/text.c
12
src/text.c
@ -123,6 +123,11 @@ void do_deletion(undo_type action)
|
|||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
add_undo(action);
|
add_undo(action);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (!ISSET(NO_NEWLINES) && foo == openfile->filebot)
|
||||||
|
/* Don't delete the magic line. */
|
||||||
|
return;
|
||||||
|
|
||||||
/* If we're deleting at the end of a line, we need to call
|
/* If we're deleting at the end of a line, we need to call
|
||||||
* edit_refresh(). */
|
* edit_refresh(). */
|
||||||
if (openfile->current->data[openfile->current_x] == '\0')
|
if (openfile->current->data[openfile->current_x] == '\0')
|
||||||
@ -145,13 +150,6 @@ void do_deletion(undo_type action)
|
|||||||
delete_node(foo);
|
delete_node(foo);
|
||||||
renumber(openfile->current);
|
renumber(openfile->current);
|
||||||
openfile->totsize--;
|
openfile->totsize--;
|
||||||
|
|
||||||
/* If the NO_NEWLINES flag isn't set, and text has been added to
|
|
||||||
* the magicline as a result of deleting at the end of the line
|
|
||||||
* before filebot, add a new magicline. */
|
|
||||||
if (!ISSET(NO_NEWLINES) && openfile->current ==
|
|
||||||
openfile->filebot && openfile->current->data[0] != '\0')
|
|
||||||
new_magicline();
|
|
||||||
} else
|
} else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user