#
f9ed317e |
| 09-May-2016 |
christos <christos@NetBSD.org> |
GNU readline(3) regards history chronologically, that is, from the perspective of the dawn of time, so "next" means "newer" and "previous" means "older". Libedit, by contrast, uses reverse chronolog
GNU readline(3) regards history chronologically, that is, from the perspective of the dawn of time, so "next" means "newer" and "previous" means "older". Libedit, by contrast, uses reverse chronology and regards history from the perspective of the present, such that "next" means "longer ago" and "previous" means "not so long ago".
The following patch fixes previous_history() and next_history() as proposed by Bastian Maerkisch.
But there is a related problem demonstrated by Bastian's regression tests that his patch did not fix: next_history() can advance not only to the newest entry, but beyond it, which core libedit cannot do. So that feature must be implemented locally in readline.c.
With that, the last of Bastians tests is fixed, test_movement_direction().
This patch also improves libedit documentation to more clearly state what "previous" and "next" mean. GNU readline documentation is just as unclear, but we can't easily fix that since libedit doesn't include its own readline.3 manual.
(Ingo Schwarze)
show more ...
|