chars.c), move_right() (renamed move_mbright() and moved to
chars.c), do_home(), do_verbatim_input(), do_delete(),
do_tab(), do_enter(), indent_length(), do_next_word(),
- do_prev_word(), do_input(), do_output(), is_whole_word(),
- strstrwrapper(), get_buffer(), unget_input(), unget_kbinput(),
- get_input(), parse_kbinput(), unparse_kbinput(),
- parse_verbatim_kbinput(), do_statusbar_input(),
- do_statusbar_home(), do_statusbar_verbatim_kbinput(),
- do_statusbar_output(), and display_string(); removal of
- buffer_to_keys() and keys_to_buffer(). (DLR)
+ do_prev_word(), do_wrap(), do_input(), do_output(),
+ is_whole_word(), strstrwrapper(), get_buffer(), unget_input(),
+ unget_kbinput(), get_input(), parse_kbinput(),
+ unparse_kbinput(), parse_verbatim_kbinput(),
+ do_statusbar_input(), do_statusbar_home(),
+ do_statusbar_verbatim_kbinput(), do_statusbar_output(), and
+ display_string(); removal of buffer_to_keys() and
+ keys_to_buffer(). (DLR)
- Add -O/--morespace command line option, plus a corresponding
Meta-O toggle and a "morespace" rcfile option. When these are
used, the normally-unused blank line below the titlebar will
/* And the toggles... */
if (currshortcut == main_list) {
for (t = toggles; t != NULL; t = t->next) {
+
assert(t->desc != NULL);
+
ptr += sprintf(ptr, "M-%c\t\t\t%s %s\n", toupper(t->val),
t->desc, _("enable/disable"));
}
/* Make a copy of a filestruct node. */
filestruct *copy_node(const filestruct *src)
{
- filestruct *dst = (filestruct *)nmalloc(sizeof(filestruct));
+ filestruct *dst;
+
assert(src != NULL);
+
+ dst = (filestruct *)nmalloc(sizeof(filestruct));
+
dst->data = mallocstrcpy(NULL, src->data);
dst->next = src->next;
dst->prev = src->prev;
dst->lineno = src->lineno;
+
return dst;
}
*end)
{
assert(newnode != NULL && begin != NULL);
+
newnode->next = end;
newnode->prev = begin;
begin->next = newnode;
void unlink_node(const filestruct *fileptr)
{
assert(fileptr != NULL);
+
if (fileptr->prev != NULL)
fileptr->prev->next = fileptr->next;
if (fileptr->next != NULL)
void delete_node(filestruct *fileptr)
{
assert(fileptr != NULL && fileptr->data != NULL);
+
if (fileptr->data != NULL)
free(fileptr->data);
free(fileptr);
filestruct *bot, size_t bot_x)
{
partition *p;
+
assert(top != NULL && bot != NULL && fileage != NULL && filebot != NULL);
/* Initialize the partition. */
void unpartition_filestruct(partition **p)
{
char *tmp;
+
assert(p != NULL && fileage != NULL && filebot != NULL);
/* Reattach the line above the top of the partition, and restore the
int i = 1;
assert(fileage == NULL || fileage != fileage->next);
+
for (temp = fileage; temp != NULL; temp = temp->next)
temp->lineno = i++;
}
int lineno = fileptr->prev->lineno;
assert(fileptr != fileptr->next);
+
for (; fileptr != NULL; fileptr = fileptr->next)
fileptr->lineno = ++lineno;
}
/* Do we have to call edit_refresh(), or can we get away with
* update_line()? */
- assert(current != NULL && current->data != NULL &&
- current_x <= strlen(current->data));
+ assert(current != NULL && current->data != NULL && current_x <= strlen(current->data));
placewewant = xplustabs();
extra = indent_length(current->data);
if (extra > current_x)
extra = current_x;
- totsize += extra;
}
#endif
newnode->data = charalloc(strlen(current->data + current_x) +
extra + 1);
strcpy(&newnode->data[extra], current->data + current_x);
#ifndef NANO_SMALL
- if (ISSET(AUTOINDENT))
+ if (ISSET(AUTOINDENT)) {
strncpy(newnode->data, current->data, extra);
+ totsize += mbstrlen(newnode->data);
+ }
#endif
null_at(¤t->data, current_x);
#ifndef NANO_SMALL
if (ISSET(AUTOINDENT)) {
strncpy(newline, indentation, indent_len);
newline[indent_len] = '\0';
+ totsize += mbstrlen(newline);
new_line_len = indent_len;
}
#endif
} else {
filestruct *temp = (filestruct *)nmalloc(sizeof(filestruct));
- /* In this case, the file size changes by +1 for the new line,
- * and +indent_len for the new indentation. */
-#ifndef NANO_SMALL
- totsize += indent_len;
-#endif
totlines++;
temp->data = newline;
temp->prev = inptr;
/* Save the values of quote_len and par_len. */
assert(quote != NULL && par != NULL);
+
*quote = quote_len;
*par = par_len;
indent_len);
strcpy(current->next->data + indent_len,
current->data + break_pos + 1);
+
assert(strlen(current->next->data) ==
indent_len + line_len - break_pos - 1);
+
totlines++;
totsize += indent_len;
par_len++;
do_input(&meta_key, &func_key, &s_or_t, &ran_func, &finished,
TRUE);
}
+
assert(FALSE);
}