fix regressions caused by the justify overhaul: when adjusting the mark,

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
master
David Lawrence Ramsey 2005-03-13 16:05:47 +00:00
parent 96b21be5cf
commit 7f9ed903ec
1 changed files with 3 additions and 2 deletions

View 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);