patch 8.1.2225: the "last used" info of a buffer is under used
Problem: The "last used" info of a buffer is under used.
Solution: Add "lastused" to getbufinfo(). List buffers sorted by last-used
field. (Andi Massimino, closes #4722)
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 9c98f99..5cc1c34 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -1407,6 +1407,9 @@
*/
if ((c == p_wc && !gotesc && KeyTyped) || c == p_wcm)
{
+ int options = WILD_NO_BEEP;
+ if (wim_flags[wim_index] & WIM_BUFLASTUSED)
+ options |= WILD_BUFLASTUSED;
if (xpc.xp_numfiles > 0) /* typed p_wc at least twice */
{
/* if 'wildmode' contains "list" may still need to list */
@@ -1419,10 +1422,10 @@
did_wild_list = TRUE;
}
if (wim_flags[wim_index] & WIM_LONGEST)
- res = nextwild(&xpc, WILD_LONGEST, WILD_NO_BEEP,
+ res = nextwild(&xpc, WILD_LONGEST, options,
firstc != '@');
else if (wim_flags[wim_index] & WIM_FULL)
- res = nextwild(&xpc, WILD_NEXT, WILD_NO_BEEP,
+ res = nextwild(&xpc, WILD_NEXT, options,
firstc != '@');
else
res = OK; /* don't insert 'wildchar' now */
@@ -1434,10 +1437,10 @@
/* if 'wildmode' first contains "longest", get longest
* common part */
if (wim_flags[0] & WIM_LONGEST)
- res = nextwild(&xpc, WILD_LONGEST, WILD_NO_BEEP,
+ res = nextwild(&xpc, WILD_LONGEST, options,
firstc != '@');
else
- res = nextwild(&xpc, WILD_EXPAND_KEEP, WILD_NO_BEEP,
+ res = nextwild(&xpc, WILD_EXPAND_KEEP, options,
firstc != '@');
/* if interrupted while completing, behave like it failed */
@@ -1488,10 +1491,10 @@
redrawcmd();
did_wild_list = TRUE;
if (wim_flags[wim_index] & WIM_LONGEST)
- nextwild(&xpc, WILD_LONGEST, WILD_NO_BEEP,
+ nextwild(&xpc, WILD_LONGEST, options,
firstc != '@');
else if (wim_flags[wim_index] & WIM_FULL)
- nextwild(&xpc, WILD_NEXT, WILD_NO_BEEP,
+ nextwild(&xpc, WILD_NEXT, options,
firstc != '@');
}
else