From: David Lawrence Ramsey Date: Tue, 13 Sep 2005 04:45:46 +0000 (+0000) Subject: more miscellaneous minor fixes X-Git-Tag: v1.3.9~30 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=feb89db8a00f271f171b3e878548a7a944e71823;p=nano.git more miscellaneous minor fixes git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3016 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index f85294c1..9b3fc4d9 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 a759f559..3b05394e 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 2758e970..6fcd19f2 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 1bd633e9..02ef346c 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