a semicolon instead of a comma between phrases.
* src/text.c (do_cutword): Don't put cut words into the cutbuffer --
that is: treat the deletion of words like pressing Backspace/Delete.
+ * src/search.c (get_history_completion, find_history): Cycle through
+ the items from newest to oldest. This fixes Savannah bug #47205.
2016-03-19 Benno Schulenberg <bensberg@justemail.net>
* src/search.c (search_init): Always remember the last typed string,
{
const filestruct *p;
- for (p = h_start; p != h_end->next && p != NULL; p = p->next) {
+ for (p = h_start; p != h_end->prev && p != NULL; p = p->prev) {
if (strncmp(s, p->data, len) == 0)
return (filestruct *)p;
}
assert(hage != NULL && hbot != NULL);
/* If this string is already in the history, delete it. */
- p = find_history(*hage, *hbot, s, strlen(s));
+ p = find_history(*hbot, *hage, s, strlen(s));
if (p != NULL) {
filestruct *foo, *bar;
assert(hage != NULL && hbot != NULL);
- /* Search the history list from the current position to the
- * bottom for a match of len characters. Skip over an exact
- * match. */
- p = find_history((*h)->next, hbot, s, len);
+ /* Search the history list from the current position to the top
+ * for a match of len characters. Skip over an exact match. */
+ p = find_history((*h)->prev, hage, s, len);
while (p != NULL && strcmp(p->data, s) == 0)
- p = find_history(p->next, hbot, s, len);
+ p = find_history(p->prev, hage, s, len);
if (p != NULL) {
*h = p;
return mallocstrcpy(s, (*h)->data);
}
- /* Search the history list from the top to the current position
+ /* Search the history list from the bottom to the current position
* for a match of len characters. Skip over an exact match. */
- p = find_history(hage, *h, s, len);
+ p = find_history(hbot, *h, s, len);
while (p != NULL && strcmp(p->data, s) == 0)
- p = find_history(p->next, *h, s, len);
+ p = find_history(p->prev, *h, s, len);
if (p != NULL) {
*h = p;