user exit (29, discovered by Joshua Jensen) [FIXED]
- Using nano -k, marked text is not cut properly. (31) [FIXED]
- Invoking -t or -k has the effect of invoking both option. (32) [FIXED]
+- totsize becomes incorrect after word-wrapping (25) [FIXED]
+ - similar problem found and corrected in do_justify
+- Wrapping a line with autoindent mode sometimes causes a segfault (19)[FIXED]
+- When inserting files, the display sometimes fails to display properly
+ until a pageup/down occurs (22)[FIXED]
** Open BUGS **
program. Nano only uses ispell (for now) (12)
- Cutting a file with marked text and both marker ends on the same line
causes a random segfault (16)
-- Wrapping a line with autoindent mode sometimes causes a segfault (19).
-- When inserting files, the display sometimes fails to display properly
- until a pageup/down occurs (22).
-- totsize becomes incorrect after word-wrapping (25)
- In search/replace code there is too much refreshing in bottomwin (26)
- In replace, there is no way to accept the default replace string. (27)
- Using nano -t, user can not exit until a filename is given via ^O. (30)
totlines++;
- totsize++;
+ /* Everything about it makes me want this line here but it causes
+ * totsize to be high by one for some reason. Sigh. (Rob) */
+ /* totsize++; */
renumber(inptr);
edit_update_top(edittop);
unlink_node(tmpnode);
delete_node(tmpnode);
-
}
+ totsize -= strlen(current->data);
+
justify_format(current->data);
slen = strlen(current->data);
- while ((strlenpt(current->data) > (fill))
- && !no_spaces(current->data)) {
- int i = 0;
- int len2 = 0;
- filestruct *tmpline = nmalloc(sizeof(filestruct));
-
- /* Start at fill , unless line isn't that long (but it appears at least
- * fill long with tabs.
- */
- if (slen > fill)
- i = fill;
- else
- i = slen;
- for (; i > 0; i--) {
- if (isspace(current->data[i]) &&
- ((strlenpt(current->data) - strlen(current->data + i)) <=
- fill)) break;
- }
- if (!i)
- break;
+ totsize += slen;
+
+ if((strlenpt(current->data) > (fill))
+ && !no_spaces(current->data)) {
+ do {
+ int i = 0;
+ int len2 = 0;
+ filestruct *tmpline = nmalloc(sizeof(filestruct));
+
+ /* Start at fill , unless line isn't that long (but it
+ * appears at least fill long with tabs.
+ */
+ if (slen > fill)
+ i = fill;
+ else
+ i = slen;
+ for (; i > 0; i--) {
+ if (isspace(current->data[i]) &&
+ ((strlenpt(current->data) - strlen(current->data +i)) <=
+ fill)) break;
+ }
+ if (!i)
+ break;
- current->data[i] = '\0';
+ current->data[i] = '\0';
- len2 = strlen(current->data + i + 1);
- tmpline->data = nmalloc(len2 + 1);
+ len2 = strlen(current->data + i + 1);
+ tmpline->data = nmalloc(len2 + 1);
- /* Skip the white space in current. */
- memcpy(tmpline->data, current->data + i + 1, len2);
- tmpline->data[len2] = '\0';
+ /* Skip the white space in current. */
+ memcpy(tmpline->data, current->data + i + 1, len2);
+ tmpline->data[len2] = '\0';
- current->data = nrealloc(current->data, i + 1);
+ current->data = nrealloc(current->data, i + 1);
- tmpline->prev = current;
- tmpline->next = current->next;
- if (current->next != NULL)
- current->next->prev = tmpline;
+ tmpline->prev = current;
+ tmpline->next = current->next;
+ if (current->next != NULL)
+ current->next->prev = tmpline;
- current->next = tmpline;
- current = tmpline;
- slen -= i + 1;
- current_y++;
+ current->next = tmpline;
+ current = tmpline;
+ slen -= i + 1;
+ current_y++;
+ } while ((strlenpt(current->data) > (fill))
+ && !no_spaces(current->data));
}
-
if (current->next)
current = current->next;
else
fix_editbot();
}
-
edit_refresh();
statusbar("Justify Complete");
return 1;