diff --git a/lua/mini/extra.lua b/lua/mini/extra.lua index 2133b0e9..aea54c84 100644 --- a/lua/mini/extra.lua +++ b/lua/mini/extra.lua @@ -1940,6 +1940,7 @@ H.list_get = { local cur_buf = vim.api.nvim_get_current_buf() local res = vim.fn.getchangelist(cur_buf)[1] for _, x in ipairs(res) do + x.col = x.col + 1 x.bufnr = cur_buf end return res diff --git a/tests/screenshots/tests-test_extra.lua---pickers---list()---works-for-`change` b/tests/screenshots/tests-test_extra.lua---pickers---list()---works-for-`change` index 46721c0b..6c083504 100644 --- a/tests/screenshots/tests-test_extra.lua---pickers---list()---works-for-`change` +++ b/tests/screenshots/tests-test_extra.lua---pickers---list()---works-for-`change` @@ -6,8 +6,8 @@ 05|} 06|~ 07|┌> ▏────────────────────────────────────────┐ -08|│ tests/dir-extra/real-files/a.lua│1│10 │ -09|│ tests/dir-extra/real-files/a.lua│3│12 │ +08|│ tests/dir-extra/real-files/a.lua│1│11 │ +09|│ tests/dir-extra/real-files/a.lua│3│13 │ 10|│ │ 11|│ │ 12|│ │ diff --git a/tests/screenshots/tests-test_extra.lua---pickers---list()---works-for-`change`-002 b/tests/screenshots/tests-test_extra.lua---pickers---list()---works-for-`change`-002 index 897e113d..16e227d5 100644 --- a/tests/screenshots/tests-test_extra.lua---pickers---list()---works-for-`change`-002 +++ b/tests/screenshots/tests-test_extra.lua---pickers---list()---works-for-`change`-002 @@ -5,7 +5,7 @@ 04| y = math.min(a, 2), 05|} 06|~ -07|┌tests/dir-extra/real-files/a.lua│1│10──────┐ +07|┌tests/dir-extra/real-files/a.lua│1│11──────┐ 08|│l Change 1 ocal a = 1 │ 09|│local t = { │ 10|│ x Change 2 = math.max(a, 2), │ @@ -28,7 +28,7 @@ 05|3000000000000000000000000000000000000000000000000000000000000000000000 06|7777777777777777777777777777777777777777777777777777777777777777777777 07|8999999999999999999999999999999999999988888887777777777777777777777777 -08|8:::::::::;::::::::::<::::::::::::::::::::::87777777777777777777777777 +08|8:::::::::;<:::::::::;::::::::::::::::::::::87777777777777777777777777 09|8=====>>>>>?>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>87777777777777777777777777 10|8>>@>>>>>>>>A>>>>????BCCCB>B>ABB>>>>>>>>>>>>87777777777777777777777777 11|8>>@>>>????BCCCB>B>ABB>>>>>>>>>>>>>>>>>>>>>>87777777777777777777777777 diff --git a/tests/test_extra.lua b/tests/test_extra.lua index 35dde46c..c58a787d 100644 --- a/tests/test_extra.lua +++ b/tests/test_extra.lua @@ -2454,12 +2454,12 @@ T['pickers']['list()']['works for `change`'] = function() -- Should properly choose by moving to position type_keys('') - eq(get_cursor(), { 1, 9 }) + eq(get_cursor(), { 1, 10 }) -- Should return chosen value validate_partial_equal_arr( { child.lua_get('_G.return_item') }, - { { bufnr = 1, col = 10, coladd = 0, lnum = 1, text = path .. '│1│10' } } + { { bufnr = 1, col = 11, coladd = 0, lnum = 1, text = path .. '│1│11' } } ) end