From 8b8ecf44f2cda43bbd710ec22ef99439b71888cd Mon Sep 17 00:00:00 2001 From: Abdelhakeem Osama Date: Tue, 3 Sep 2019 19:18:24 +0200 Subject: shada/context: fully remove jumplist duplicates #10898 - Always load files when cleaning up jumplist. - For Shada: avoids writing duplicate entries, which happens when you read from a shada file with duplicate entries (merging the jumplist while writing sometimes produces duplicate entries, bug?) and then write right away (i.e.: without any `:jumps`, `getjumplist()`, or any jump movement, that is: nothing that calls `cleanup_jumplist` with `loadfiles == true`). - For Context: avoids non-idempotent behavior for the same reason (i.e.: first call to `shada_encode_jumps` does not remove duplicate entries). - Do not set pcmark when dumping jumplist for Context. - Retrieving current Context shouldn't add an entry to the jumplist (which will be removed by a subsequent `cleanup_jumplist` anyway, i.e.: tail entry matching current position), just act like `getjumplist` for instance. --- test/functional/api/vim_spec.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'test/functional/api/vim_spec.lua') diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 5df86b3261..07c0c5c8f3 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -922,11 +922,9 @@ describe('API', function() }, ['jumps'] = eval(([[ - filter(map(add( - getjumplist()[0], { 'bufnr': bufnr('%'), 'lnum': getcurpos()[1] }), - 'filter( - { "f": expand("#".v:val.bufnr.":p"), "l": v:val.lnum }, - { k, v -> k != "l" || v != 1 })'), '!empty(v:val.f)') + filter(map(getjumplist()[0], 'filter( + { "f": expand("#".v:val.bufnr.":p"), "l": v:val.lnum }, + { k, v -> k != "l" || v != 1 })'), '!empty(v:val.f)') ]]):gsub('\n', '')), ['buflist'] = eval([[ -- cgit