mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
* exit.c (edit_delete_line): Don't remove and restore the
preceding newline. Don't treat binary zero as newline. From Dmitry Semyonov <Dmitry.Semyonov@oktet.ru>
This commit is contained in:
parent
895c9468c3
commit
c6e56452ea
@ -1,3 +1,9 @@
|
||||
2002-11-14 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* exit.c (edit_delete_line): Don't remove and restore the
|
||||
preceding newline. Don't treat binary zero as newline.
|
||||
From Dmitry Semyonov <Dmitry.Semyonov@oktet.ru>
|
||||
|
||||
2002-11-12 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* *.c: Fix all global functions without declarations - declare,
|
||||
|
35
edit/edit.c
35
edit/edit.c
@ -1765,17 +1765,32 @@ static void edit_delete_to_line_begin (WEdit * edit)
|
||||
}
|
||||
}
|
||||
|
||||
void edit_delete_line (WEdit * edit)
|
||||
void
|
||||
edit_delete_line (WEdit *edit)
|
||||
{
|
||||
int c;
|
||||
do {
|
||||
c = edit_delete (edit);
|
||||
} while (c != '\n' && c);
|
||||
do {
|
||||
c = edit_backspace (edit);
|
||||
} while (c != '\n' && c);
|
||||
if (c)
|
||||
edit_insert (edit, '\n');
|
||||
/*
|
||||
* Delete right part of the line.
|
||||
* Note that edit_get_byte() returns '\n' when byte position is
|
||||
* beyond EOF.
|
||||
*/
|
||||
while (edit_get_byte (edit, edit->curs1) != '\n') {
|
||||
(void) edit_delete (edit);
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete '\n' char.
|
||||
* Note that edit_delete() will not corrupt anything if called while
|
||||
* cursor position is EOF.
|
||||
*/
|
||||
(void) edit_delete (edit);
|
||||
|
||||
/*
|
||||
* Delete left part of the line.
|
||||
* Note, that edit_get_byte() returns '\n' when byte position is < 0.
|
||||
*/
|
||||
while (edit_get_byte (edit, edit->curs1 - 1) != '\n') {
|
||||
(void) edit_backspace (edit);
|
||||
};
|
||||
}
|
||||
|
||||
static void insert_spaces_tab (WEdit * edit, int half)
|
||||
|
Loading…
Reference in New Issue
Block a user