rely on fileage and filebot instead of NULL for their checks to detect
the top or bottom of the file
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3143
35c25a1d-7b9e-4130-9fde-
d3aeb78583b8
do_page_down(), do_para_end(), do_next_word(), do_prev_word(),
do_up(), do_down(), do_scroll_down(), do_right(), do_mouse(),
do_gotolinecolumn(), do_delete(), begpar(), find_paragraph(),
- and do_justify(). (DLR)
+ do_justify(), do_wrap(), remove_magicline(), edit_scroll(),
+ and edit_update(). (DLR)
- Add new -L/--nonewlines command line option, and new
"nonewlines" rcfile option, to control whether nano adds
magiclines to the ends of files. Changes to read_file(),
/* We prepend the wrapped text to the next line, if the
* same_line_wrap flag is set, there is a next line, and prepending
* would not make the line too long. */
- if (same_line_wrap && line->next != NULL) {
+ if (same_line_wrap && line != openfile->filebot) {
const char *end = after_break + move_mbleft(after_break,
after_break_len);
void remove_magicline(void)
{
if (openfile->filebot->data[0] == '\0' &&
- openfile->filebot->prev != NULL) {
+ openfile->filebot != openfile->fileage) {
openfile->filebot = openfile->filebot->prev;
free_filestruct(openfile->filebot->next);
openfile->filebot->next = NULL;
* there are fewer than nlines lines available. */
for (i = nlines; i > 0; i--) {
if (direction == UP) {
- if (openfile->edittop->prev == NULL)
+ if (openfile->edittop == openfile->fileage)
break;
openfile->edittop = openfile->edittop->prev;
} else {
- if (openfile->edittop->next == NULL)
+ if (openfile->edittop == openfile->filebot)
break;
openfile->edittop = openfile->edittop->next;
}
goal = editwinrows - 1;
}
- for (; goal > 0 && foo->prev != NULL; goal--)
+ for (; goal > 0 && foo != openfile->edittop; goal--)
foo = foo->prev;
openfile->edittop = foo;