CVS code -
- General:
- Miscellaneous comment fixes. (DLR)
+ - More int -> bool conversions. (DLR)
- Fix a few last instances of the current line number's being
saved as an int instead of a ssize_t. Changes to
renumber_all(), renumber(), do_alt_speller(), and
get_history_completion()
- Make parameters const where possible. (DLR)
- text.c:
+ do_enter()
+ - Don't update the edit window until we set placewewant. (DLR)
do_word_count()
- Rename to do_wordlinechar_count(), and expand to also count
the number of lines and characters in the file or selection,
void edit_add(const filestruct *fileptr, const char *converted, int
yval, size_t start);
void update_line(const filestruct *fileptr, size_t index);
-int need_horizontal_update(size_t old_pww);
-int need_vertical_update(size_t old_pww);
+bool need_horizontal_update(size_t old_pww);
+bool need_vertical_update(size_t old_pww);
void edit_scroll(scroll_dir direction, ssize_t nlines);
void edit_redraw(const filestruct *old_current, size_t old_pww);
void edit_refresh(void);
#endif
}
-/* Someone hits Return *gasp!* */
+/* Someone hits Enter *gasp!* */
void do_enter(void)
{
filestruct *newnode = make_new_node(openfile->current);
renumber(openfile->current);
openfile->current = newnode;
- edit_refresh();
-
openfile->totsize++;
set_modified();
+
openfile->placewewant = xplustabs();
+
+ edit_refresh();
}
#ifndef NANO_SMALL
mvwaddch(edit, line, COLS - 1, '$');
}
-/* Return a nonzero value if we need an update after moving
- * horizontally. We need one if the mark is on or if old_pww and
+/* Return TRUE if we need an update after moving horizontally, and FALSE
+ * otherwise. We need one if the mark is on or if old_pww and
* placewewant are on different pages. */
-int need_horizontal_update(size_t old_pww)
+bool need_horizontal_update(size_t old_pww)
{
return
#ifndef NANO_SMALL
get_page_start(openfile->placewewant);
}
-/* Return a nonzero value if we need an update after moving vertically.
- * We need one if the mark is on or if old_pww and placewewant
- * are on different pages. */
-int need_vertical_update(size_t old_pww)
+/* Return TRUE if we need an update after moving vertically, and FALSE
+ * otherwise. We need one if the mark is on or if old_pww and
+ * placewewant are on different pages. */
+bool need_vertical_update(size_t old_pww)
{
return
#ifndef NANO_SMALL