]> git.wh0rd.org Git - nano.git/commitdiff
fix regressions caused by the justify overhaul: when adjusting the mark,
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Sun, 13 Mar 2005 16:05:47 +0000 (16:05 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Sun, 13 Mar 2005 16:05:47 +0000 (16:05 +0000)
take the indentation length into account, and don't declare an
indent_len variable inside a loop when we already have one outside

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

src/nano.c

index d4c71ee0da13a5cec2a15c5631a946ec020121f2..52c1d0af48fe95e09bab0684dc02c190bce9dec3 100644 (file)
@@ -2999,7 +2999,7 @@ void do_justify(bool full_justify)
            bool past_first_line = FALSE;
 
            for (i = 0; i < par_len; i++) {
-               size_t indent_len = quote_len +
+               indent_len = quote_len +
                        indent_length(indent_line->data + quote_len);
 
                if (indent_len != strlen(indent_string)) {
@@ -3054,7 +3054,7 @@ void do_justify(bool full_justify)
             * in the next line. */
            if (mark_beginbuf == next_line) {
                mark_beginbuf = current;
-               mark_beginx += line_len;
+               mark_beginx += line_len - indent_len;
            }
 #endif
 
@@ -3131,6 +3131,7 @@ void do_justify(bool full_justify)
            /* Break the line.  If this isn't the last line of the
             * paragraph, add a space after where we break it. */
            null_at(&current->data, break_pos);
+
            if (par_len > 1) {
                current->data = charealloc(current->data,
                        break_pos + 2);