Mercurial > vim
comparison src/ex_getln.c @ 18463:18d7337b6837 v8.1.2225
patch 8.1.2225: the "last used" info of a buffer is under used
Commit: https://github.com/vim/vim/commit/52410575be50d5c40bbe6380159df48cfc382ceb
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Oct 27 05:12:45 2019 +0100
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 27 Oct 2019 05:15:06 +0100 |
parents | 71199e360948 |
children | fd95d4dbeb37 |
comparison
equal
deleted
inserted
replaced
18462:395349479800 | 18463:18d7337b6837 |
---|---|
1405 * - wildcard expansion is only done when the 'wildchar' key is really | 1405 * - wildcard expansion is only done when the 'wildchar' key is really |
1406 * typed, not when it comes from a macro | 1406 * typed, not when it comes from a macro |
1407 */ | 1407 */ |
1408 if ((c == p_wc && !gotesc && KeyTyped) || c == p_wcm) | 1408 if ((c == p_wc && !gotesc && KeyTyped) || c == p_wcm) |
1409 { | 1409 { |
1410 int options = WILD_NO_BEEP; | |
1411 if (wim_flags[wim_index] & WIM_BUFLASTUSED) | |
1412 options |= WILD_BUFLASTUSED; | |
1410 if (xpc.xp_numfiles > 0) /* typed p_wc at least twice */ | 1413 if (xpc.xp_numfiles > 0) /* typed p_wc at least twice */ |
1411 { | 1414 { |
1412 /* if 'wildmode' contains "list" may still need to list */ | 1415 /* if 'wildmode' contains "list" may still need to list */ |
1413 if (xpc.xp_numfiles > 1 | 1416 if (xpc.xp_numfiles > 1 |
1414 && !did_wild_list | 1417 && !did_wild_list |
1417 (void)showmatches(&xpc, FALSE); | 1420 (void)showmatches(&xpc, FALSE); |
1418 redrawcmd(); | 1421 redrawcmd(); |
1419 did_wild_list = TRUE; | 1422 did_wild_list = TRUE; |
1420 } | 1423 } |
1421 if (wim_flags[wim_index] & WIM_LONGEST) | 1424 if (wim_flags[wim_index] & WIM_LONGEST) |
1422 res = nextwild(&xpc, WILD_LONGEST, WILD_NO_BEEP, | 1425 res = nextwild(&xpc, WILD_LONGEST, options, |
1423 firstc != '@'); | 1426 firstc != '@'); |
1424 else if (wim_flags[wim_index] & WIM_FULL) | 1427 else if (wim_flags[wim_index] & WIM_FULL) |
1425 res = nextwild(&xpc, WILD_NEXT, WILD_NO_BEEP, | 1428 res = nextwild(&xpc, WILD_NEXT, options, |
1426 firstc != '@'); | 1429 firstc != '@'); |
1427 else | 1430 else |
1428 res = OK; /* don't insert 'wildchar' now */ | 1431 res = OK; /* don't insert 'wildchar' now */ |
1429 } | 1432 } |
1430 else /* typed p_wc first time */ | 1433 else /* typed p_wc first time */ |
1432 wim_index = 0; | 1435 wim_index = 0; |
1433 j = ccline.cmdpos; | 1436 j = ccline.cmdpos; |
1434 /* if 'wildmode' first contains "longest", get longest | 1437 /* if 'wildmode' first contains "longest", get longest |
1435 * common part */ | 1438 * common part */ |
1436 if (wim_flags[0] & WIM_LONGEST) | 1439 if (wim_flags[0] & WIM_LONGEST) |
1437 res = nextwild(&xpc, WILD_LONGEST, WILD_NO_BEEP, | 1440 res = nextwild(&xpc, WILD_LONGEST, options, |
1438 firstc != '@'); | 1441 firstc != '@'); |
1439 else | 1442 else |
1440 res = nextwild(&xpc, WILD_EXPAND_KEEP, WILD_NO_BEEP, | 1443 res = nextwild(&xpc, WILD_EXPAND_KEEP, options, |
1441 firstc != '@'); | 1444 firstc != '@'); |
1442 | 1445 |
1443 /* if interrupted while completing, behave like it failed */ | 1446 /* if interrupted while completing, behave like it failed */ |
1444 if (got_int) | 1447 if (got_int) |
1445 { | 1448 { |
1486 (void)showmatches(&xpc, FALSE); | 1489 (void)showmatches(&xpc, FALSE); |
1487 #endif | 1490 #endif |
1488 redrawcmd(); | 1491 redrawcmd(); |
1489 did_wild_list = TRUE; | 1492 did_wild_list = TRUE; |
1490 if (wim_flags[wim_index] & WIM_LONGEST) | 1493 if (wim_flags[wim_index] & WIM_LONGEST) |
1491 nextwild(&xpc, WILD_LONGEST, WILD_NO_BEEP, | 1494 nextwild(&xpc, WILD_LONGEST, options, |
1492 firstc != '@'); | 1495 firstc != '@'); |
1493 else if (wim_flags[wim_index] & WIM_FULL) | 1496 else if (wim_flags[wim_index] & WIM_FULL) |
1494 nextwild(&xpc, WILD_NEXT, WILD_NO_BEEP, | 1497 nextwild(&xpc, WILD_NEXT, options, |
1495 firstc != '@'); | 1498 firstc != '@'); |
1496 } | 1499 } |
1497 else | 1500 else |
1498 vim_beep(BO_WILD); | 1501 vim_beep(BO_WILD); |
1499 } | 1502 } |