commit feb89db8a00f271f171b3e878548a7a944e71823
parent 239b4157861d0b080fd38166649d31ae6ff962da
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Tue, 13 Sep 2005 04:45:46 +0000
more miscellaneous minor fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3016 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
4 files changed, 16 insertions(+), 12 deletions(-)
diff --git 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
@@ -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
@@ -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
@@ -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