diff options
author | Antoine Busque <antoinebusque@gmail.com> | 2017-08-02 23:02:00 -0400 |
---|---|---|
committer | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2017-08-07 20:14:18 +0200 |
commit | a058a018f50ddab9c9ce54c3fe18e37031e32973 (patch) | |
tree | e19101efca8f0b8c991a807c62945dc6e630888c | |
parent | 8fc0f15412654e8520fb0a97430063bbb70634e0 (diff) | |
download | ratpoison-a058a018f50ddab9c9ce54c3fe18e37031e32973.zip |
Fix: call using_history after initializing history entries
In its current state, history expansion requiring any sort of string
lookup is not working, always returing "event not found". This is due
to `history_offset` being set improperly by an early call to
`using_history`.
A call to `using_history` needs to follow, not precede, the loop
performing initialization of history entries found in
`history_expand_line`. This allows for `history_offset` to reflect the
now non-zero length of the history, restoring the expected behaviour
of history expansion.
Tested-by: Martin Hertz <mvhertz@gmail.com>
Signed-off-by: Antoine Busque <antoinebusque@gmail.com>
-rw-r--r-- | src/history.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/history.c b/src/history.c index d1e9938..1466e89 100644 --- a/src/history.c +++ b/src/history.c @@ -314,10 +314,10 @@ history_expand_line (int history_id UNUSED, char *string, char **output) if (strchr (string, '!')) { clear_history (); - using_history (); list_for_each_entry(item, &histories[history_id].head, node) { add_history (item->line); } + using_history (); return history_expand (string, output); } #endif |