mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-22 12:51:23 +03:00
oops; do_yesno() doesn't need display_string(); it only needs to use
actual_x() to get the actual number of characters in buf when it calls mvwaddnstr() git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2754 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
parent
8d5beb560c
commit
d4ea5b69c5
@ -327,9 +327,8 @@ CVS code -
|
||||
(DLR)
|
||||
do_yesno()
|
||||
- Allow refreshing the screen via Ctrl-L, as Pico does. (DLR)
|
||||
- Add a missing assert, and use display_string() to display the
|
||||
prompt, so that we don't end it in the middle of a multibyte
|
||||
character if it's more than (COLS - 1) bytes long. (DLR)
|
||||
- Add a missing assert, and use actual_x() to calculate the
|
||||
number of characters buf takes up, in case it's UTF-8. (DLR)
|
||||
total_redraw()
|
||||
- Simplify to call clearok(TRUE) and wrefresh() on curscr, which
|
||||
updates the entire screen in fewer function calls without
|
||||
|
@ -2410,7 +2410,7 @@ void nanoget_repaint(const char *buf, const char *inputbuf, size_t x)
|
||||
wattron(bottomwin, A_REVERSE);
|
||||
blank_statusbar();
|
||||
|
||||
mvwaddstr(bottomwin, 0, 0, buf);
|
||||
mvwaddnstr(bottomwin, 0, 0, buf, actual_x(buf, COLS - 2));
|
||||
waddch(bottomwin, ':');
|
||||
|
||||
if (COLS > 1)
|
||||
@ -3607,7 +3607,6 @@ int do_yesno(bool all, const char *msg)
|
||||
const char *yesstr; /* String of yes characters accepted. */
|
||||
const char *nostr; /* Same for no. */
|
||||
const char *allstr; /* And all, surprise! */
|
||||
char *expmsg; /* Expanded version of msg. */
|
||||
|
||||
assert(msg != NULL);
|
||||
|
||||
@ -3651,10 +3650,7 @@ int do_yesno(bool all, const char *msg)
|
||||
wattron(bottomwin, A_REVERSE);
|
||||
|
||||
blank_statusbar();
|
||||
|
||||
expmsg = display_string(msg, 0, COLS - 1, FALSE);
|
||||
mvwaddstr(bottomwin, 0, 0, msg);
|
||||
free(expmsg);
|
||||
mvwaddnstr(bottomwin, 0, 0, msg, actual_x(msg, COLS - 1));
|
||||
|
||||
wattroff(bottomwin, A_REVERSE);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user