- Fix erroneous #ifdef that resulted in the -d/--rebinddelete
and -k/--cut options' not being printed when NANO_SMALL was
defined. (DLR)
+ do_justify()
+ - Instead of breaking a line at a space and readding the space
+ afterwards, just break the line after the space, as it's more
+ efficient. (DLR)
- utils.c:
regexec_safe()
- Rename to safe_regexec() for consistency. (DLR)
assert(break_pos < line_len);
- /* Make a new line and copy the text after where we broke
- * this line to the beginning of the new line. */
+ /* Make a new line, and copy the text after where we're
+ * going to break this line to the beginning of the new
+ * line. */
splice_node(current, make_new_node(current), current->next);
/* If this paragraph is non-quoted, and autoindent isn't
par_len++;
totlines++;
- totsize += indent_len;
+ totsize += indent_len + 1;
#ifndef NANO_SMALL
/* Adjust the mark coordinates to compensate for the change
}
#endif
- /* Break the line, and add the space back to where we broke
- * it. */
- null_at(¤t->data, break_pos);
-
- current->data = charealloc(current->data, break_pos + 2);
- current->data[break_pos] = ' ';
- current->data[break_pos + 1] = '\0';
-
- totsize++;
+ /* Break the line at the character just after the space. */
+ null_at(¤t->data, break_pos + 1);
/* Go to the next line. */
par_len--;