]> git.wh0rd.org Git - nano.git/commitdiff
tweak do_para_end() to remove the assumption that the file always ends
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Wed, 9 Nov 2005 04:20:55 +0000 (04:20 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Wed, 9 Nov 2005 04:20:55 +0000 (04:20 +0000)
in a magicline

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3123 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/move.c

index 620f65e3be5287910624a7f5c3f1564cc4d6a8c4..2bfca09e8db09fa905b0f99d0f89e31d9ade2abb 100644 (file)
--- 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(),
index 36053551b2ca548084804db9205fa8ff927d187a..41a6b676e38108703c8c5167cb58e006237dfa0e 100644 (file)
@@ -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);