nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 7f9ed903ec2913ba5ac51ac6764cd9c544c2e517
parent 96b21be5cf3cb3c777b23d03046c15a9e8db76f1
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Sun, 13 Mar 2005 16:05:47 +0000

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

Diffstat:
Msrc/nano.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/nano.c b/src/nano.c @@ -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);