Commit 239c3d47 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

in nanogetstr(), make sure that magichistory is properly updated when we

change it and then move up


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2897 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 10 additions and 8 deletions
+10 -8
...@@ -70,9 +70,11 @@ CVS code - ...@@ -70,9 +70,11 @@ CVS code -
do_cursorpos(). (DLR) do_cursorpos(). (DLR)
- Change the NANO_WIDE #define to ENABLE_UTF8, as the latter is - Change the NANO_WIDE #define to ENABLE_UTF8, as the latter is
clearer. (DLR) clearer. (DLR)
- Make sure that the current position in the history list is - Minor history code fixes: Make sure that the current position
properly set to the bottom if we cancel out of the prompt. in the history list is properly set to the bottom if we cancel
New function history_reset(); changes to nanogetstr(). (DLR) out of the prompt, and that magichistory is properly updated
when we change it and then move up. New function
history_reset(); changes to nanogetstr(). (DLR)
- chars.c: - chars.c:
mbstrchr() mbstrchr()
- Don't count matches between valid and invalid multibyte - Don't count matches between valid and invalid multibyte
......
...@@ -2576,12 +2576,12 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer, ...@@ -2576,12 +2576,12 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer,
#ifndef NANO_SMALL #ifndef NANO_SMALL
if (history_list != NULL) { if (history_list != NULL) {
/* If we're scrolling up at the bottom of the /* If we're scrolling up at the bottom of the
* history list, answer isn't blank, and * history list and answer isn't blank, save answer
* magichistory isn't set, save answer in * in magichistory. */
* magichistory. */
if ((*history_list)->next == NULL && if ((*history_list)->next == NULL &&
answer[0] != '\0' && magichistory == NULL) answer[0] != '\0')
magichistory = mallocstrcpy(NULL, answer); magichistory = mallocstrcpy(magichistory,
answer);
/* Get the older search from the history list and /* Get the older search from the history list and
* save it in answer. If there is no older search, * save it in answer. If there is no older search,
......
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