commit 5dcba30395e5fe181ecf37659bb1d89b60a8b474
parent 7bf00de84fe532d25b058e31e84b27f9b59f6a1e
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Sun, 28 Sep 2003 19:15:18 +0000
a few missing minor bits of DB's refactored display code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1559 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
2 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -46,12 +46,12 @@ CVS code -
instead of several; and do some other minor refactoring of
related display functions to simplify them. New functions
mark_order() and display_string(); changes to actual_x(),
- edit_add(), update_line(), statusbar(), and
- do_replace_highlight(). (David Benbennick) DLR: Add minor
- cosmetic tweaks, add missing NANO_SMALL #ifdef around the text
- for a backwards search in the refactored code, and enclose
- dump_buffer() and dump_buffer_reverse() in one ENABLE_DEBUG
- #ifdef instead of two.
+ strnlenpt(), blank_bottombars(), edit_add(), update_line(),
+ statusbar(), and do_replace_highlight(). (David Benbennick)
+ DLR: Add minor cosmetic tweaks, add missing NANO_SMALL #ifdef
+ around the text for a backwards search in the refactored code,
+ and enclose dump_buffer() and dump_buffer_reverse() in one
+ ENABLE_DEBUG #ifdef instead of two.
- Convert memmove() function calls to charmove() macro calls, as
the former all work on char*'s. (DLR)
- files.c:
diff --git a/src/winio.c b/src/winio.c
@@ -367,23 +367,25 @@ size_t actual_x(const char *str, size_t xplus)
return i;
}
-/* A strlen with tabs factored in, similar to xplustabs(). */
+/* A strlen with tabs factored in, similar to xplustabs(). How many
+ * columns wide are the first size characters of buf? */
size_t strnlenpt(const char *buf, size_t size)
{
size_t length = 0;
- if (buf != NULL)
- for (; *buf != '\0' && size != 0; size--, buf++) {
- if (*buf == '\t')
- length += tabsize - (length % tabsize);
- else if (is_cntrl_char((int)*buf))
- length += 2;
- else
- length++;
- }
+ assert(buf != NULL);
+ for (; *buf != '\0' && size != 0; size--, buf++) {
+ if (*buf == '\t')
+ length += tabsize - (length % tabsize);
+ else if (is_cntrl_char((int)*buf))
+ length += 2;
+ else
+ length++;
+ }
return length;
}
+/* How many columns wide is buf? */
size_t strlenpt(const char *buf)
{
return strnlenpt(buf, -1);
@@ -391,7 +393,7 @@ size_t strlenpt(const char *buf)
void blank_bottombars(void)
{
- if (!no_help()) {
+ if (!ISSET(NO_HELP)) {
mvwaddstr(bottomwin, 1, 0, hblank);
mvwaddstr(bottomwin, 2, 0, hblank);
}