Commit 08cd7ef2 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

fix an assert, update another copyright year, and add a few more of DB's

tweaks to fix a few minor bugs with UTF-8 display at the statusbar
prompt


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2213 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 9 additions and 9 deletions
+9 -9
...@@ -70,11 +70,11 @@ CVS code - ...@@ -70,11 +70,11 @@ CVS code -
do_statusbar_backspace(), do_statusbar_delete(), do_statusbar_backspace(), do_statusbar_delete(),
do_statusbar_cut_text(), and do_statusbar_output(). (DLR) do_statusbar_cut_text(), and do_statusbar_output(). (DLR)
- Even more steps toward wide character/multibyte character - Even more steps toward wide character/multibyte character
support. Movement and (most) cursor display at the statusbar support. Movement and cursor display at the statusbar prompt
prompt should now work properly with a string containing should now work properly with a string containing multibyte
multibyte characters, and text display of such strings should characters, and text display of such strings should now work
now (mostly) work properly as well. Changes to properly as well. Changes to search_init(),
do_statusbar_right(), do_statusbar_left(), nanoget_repaint(), do_statusbar_right(), do_statusbar_left(),
do_statusbar_backspace(), and do_statusbar_delete(). (David do_statusbar_backspace(), and do_statusbar_delete(). (David
Benbennick and DLR) Benbennick and DLR)
- Implement cutting from the current position to the end of the - Implement cutting from the current position to the end of the
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/************************************************************************** /**************************************************************************
* search.c * * search.c *
* * * *
* Copyright (C) 2000-2004 Chris Allegretta * * Copyright (C) 2000-2005 Chris Allegretta *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2, or (at your option) * * the Free Software Foundation; either version 2, or (at your option) *
...@@ -152,7 +152,7 @@ int search_init(bool replacing, bool use_answer) ...@@ -152,7 +152,7 @@ int search_init(bool replacing, bool use_answer)
if (last_search[0] != '\0') { if (last_search[0] != '\0') {
char *disp = display_string(last_search, 0, COLS / 3, FALSE); char *disp = display_string(last_search, 0, COLS / 3, FALSE);
buf = charalloc(COLS / 3 + 7); buf = charalloc(strlen(disp) + 7);
/* We use COLS / 3 here because we need to see more on the /* We use COLS / 3 here because we need to see more on the
* line. */ * line. */
sprintf(buf, " [%s%s]", disp, sprintf(buf, " [%s%s]", disp,
......
...@@ -2329,9 +2329,9 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool ...@@ -2329,9 +2329,9 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
void nanoget_repaint(const char *buf, const char *inputbuf, size_t x) void nanoget_repaint(const char *buf, const char *inputbuf, size_t x)
{ {
size_t x_real = strnlenpt(inputbuf, x); size_t x_real = strnlenpt(inputbuf, x);
int wid = COLS - strlen(buf) - 2; int wid = COLS - strlenpt(buf) - 2;
assert(0 <= x && x <= strlen(inputbuf)); assert(x <= strlen(inputbuf));
wattron(bottomwin, A_REVERSE); wattron(bottomwin, A_REVERSE);
blank_statusbar(); blank_statusbar();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment