=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/status.c,v retrieving revision 1.35 retrieving revision 1.36 diff -c -r1.35 -r1.36 *** src/usr.bin/tmux/status.c 2009/09/23 06:18:48 1.35 --- src/usr.bin/tmux/status.c 2009/09/23 14:42:48 1.36 *************** *** 1,4 **** ! /* $OpenBSD: status.c,v 1.35 2009/09/23 06:18:48 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: status.c,v 1.36 2009/09/23 14:42:48 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 673,680 **** xfree(c->prompt_string); c->prompt_string = NULL; - if (c->prompt_flags & PROMPT_HIDDEN) - memset(c->prompt_buffer, 0, strlen(c->prompt_buffer)); xfree(c->prompt_buffer); c->prompt_buffer = NULL; --- 673,678 ---- *************** *** 739,764 **** left--; size = left; } ! if (c->prompt_flags & PROMPT_HIDDEN) ! size = 0; ! else { ! screen_write_puts(&ctx, &gc, ! "%.*s", (int) left, c->prompt_buffer + off); ! } for (i = len + size; i < c->tty.sx; i++) screen_write_putc(&ctx, &gc, ' '); /* Draw a fake cursor. */ ch = ' '; ! if (c->prompt_flags & PROMPT_HIDDEN) ! screen_write_cursormove(&ctx, len, 0); ! else { ! screen_write_cursormove(&ctx, ! len + c->prompt_index - off, 0); ! if (c->prompt_index < strlen(c->prompt_buffer)) ! ch = c->prompt_buffer[c->prompt_index]; ! } gc.attr ^= GRID_ATTR_REVERSE; screen_write_putc(&ctx, &gc, ch); } --- 737,753 ---- left--; size = left; } ! screen_write_puts( ! &ctx, &gc, "%.*s", (int) left, c->prompt_buffer + off); for (i = len + size; i < c->tty.sx; i++) screen_write_putc(&ctx, &gc, ' '); /* Draw a fake cursor. */ ch = ' '; ! screen_write_cursormove(&ctx, len + c->prompt_index - off, 0); ! if (c->prompt_index < strlen(c->prompt_buffer)) ! ch = c->prompt_buffer[c->prompt_index]; gc.attr ^= GRID_ATTR_REVERSE; screen_write_putc(&ctx, &gc, ch); } *************** *** 892,899 **** case MODEKEYEDIT_HISTORYUP: if (ARRAY_LENGTH(&c->prompt_hdata) == 0) break; - if (c->prompt_flags & PROMPT_HIDDEN) - memset(c->prompt_buffer, 0, strlen(c->prompt_buffer)); xfree(c->prompt_buffer); c->prompt_buffer = xstrdup(ARRAY_ITEM(&c->prompt_hdata, --- 881,886 ---- *************** *** 905,912 **** c->flags |= CLIENT_STATUS; break; case MODEKEYEDIT_HISTORYDOWN: - if (c->prompt_flags & PROMPT_HIDDEN) - memset(c->prompt_buffer, 0, strlen(c->prompt_buffer)); xfree(c->prompt_buffer); if (c->prompt_hindex != 0) { --- 892,897 ----