diff --git a/ChangeLog b/ChangeLog index f85294c12afccb109ad93b04983061c0cb3f9c63..9b3fc4d90fd5ef4c786ab5ab7aeb36d292fc2380 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 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 @@ -302,6 +303,8 @@ CVS code - 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, diff --git a/src/proto.h b/src/proto.h index a759f559073c589d7ca36d11d715ade2e58c789f..3b05394e878e6f02ad89a7994ff3d6b71144115a 100644 --- a/src/proto.h +++ b/src/proto.h @@ -667,8 +667,8 @@ void reset_cursor(void); 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); diff --git a/src/text.c b/src/text.c index 2758e970351e02deaa9be46c45f968105ced2234..6fcd19f2161e3a4ae4e27df741ebfce9f3943e9a 100644 --- a/src/text.c +++ b/src/text.c @@ -186,7 +186,7 @@ void do_tab(void) #endif } -/* Someone hits Return *gasp!* */ +/* Someone hits Enter *gasp!* */ void do_enter(void) { filestruct *newnode = make_new_node(openfile->current); @@ -234,11 +234,12 @@ void do_enter(void) renumber(openfile->current); openfile->current = newnode; - edit_refresh(); - openfile->totsize++; set_modified(); + openfile->placewewant = xplustabs(); + + edit_refresh(); } #ifndef NANO_SMALL diff --git a/src/winio.c b/src/winio.c index 1bd633e91e7e8b33ae4cd985f3f0d1c12b83f8f7..02ef346c58f56dee0664efcce2d30f3f836b092f 100644 --- a/src/winio.c +++ b/src/winio.c @@ -3477,10 +3477,10 @@ void update_line(const filestruct *fileptr, size_t index) 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 @@ -3490,10 +3490,10 @@ int need_horizontal_update(size_t old_pww) 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