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
master
David Lawrence Ramsey 2003-09-28 19:15:18 +00:00
parent 7bf00de84f
commit 5dcba30395
2 changed files with 19 additions and 17 deletions

View File

@ -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:

View File

@ -367,12 +367,13 @@ 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)
assert(buf != NULL);
for (; *buf != '\0' && size != 0; size--, buf++) {
if (*buf == '\t')
length += tabsize - (length % tabsize);
@ -384,6 +385,7 @@ size_t strnlenpt(const char *buf, size_t size)
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);
}