diff --git a/ChangeLog b/ChangeLog index 620f65e3..2bfca09e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -40,8 +40,8 @@ CVS code - - Tweak a few functions to remove the assumption that the file always ends in a magicline. Changes to cut_line(), do_cut_till_end(), open_buffer(), read_file(), write_file(), - do_last_line(), do_alt_speller(), and do_wordlinechar_count(). - (DLR) + do_last_line(), do_para_end(), do_alt_speller(), and + do_wordlinechar_count(). (DLR) - Tweak a few functions to rely on fileage and filebot instead of NULL for their checks to detect the top or bottom of the file. Changes to cut_line(), cut_to_eol(), do_page_up(), diff --git a/src/move.c b/src/move.c index 36053551..41a6b676 100644 --- a/src/move.c +++ b/src/move.c @@ -148,9 +148,6 @@ void do_para_begin(bool allow_update) check_statusblank(); - openfile->current_x = 0; - openfile->placewewant = 0; - if (openfile->current != openfile->fileage) { do { openfile->current = openfile->current->prev; @@ -158,6 +155,9 @@ void do_para_begin(bool allow_update) } while (!begpar(openfile->current)); } + openfile->current_x = 0; + openfile->placewewant = 0; + if (allow_update) edit_redraw(current_save, pww_save); } @@ -178,9 +178,6 @@ void do_para_end(bool allow_update) check_statusblank(); - openfile->current_x = 0; - openfile->placewewant = 0; - while (openfile->current != openfile->filebot && !inpar(openfile->current)) openfile->current = openfile->current->next; @@ -192,8 +189,14 @@ void do_para_end(bool allow_update) openfile->current_y++; } - if (openfile->current != openfile->filebot) + if (openfile->current != openfile->filebot) { openfile->current = openfile->current->next; + openfile->current_x = 0; + openfile->placewewant = 0; + } else { + openfile->current_x = strlen(openfile->current->data); + openfile->placewewant = xplustabs(); + } if (allow_update) edit_redraw(current_save, pww_save);