diff options
author | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-05-06 15:57:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-06 15:57:10 -0700 |
commit | a3e914b64c621605f91d7284f3050f7fed57a856 (patch) | |
tree | f4a331ad691e62c4ae598e10906fc1009b5c5f6c | |
parent | 71107e12c7b68d8faf1bcc1a5794a55b21e146f3 (diff) | |
parent | 9149fe48a91a60f61a0b461231e894f0884835fd (diff) | |
download | rneovim-a3e914b64c621605f91d7284f3050f7fed57a856.tar.gz rneovim-a3e914b64c621605f91d7284f3050f7fed57a856.tar.bz2 rneovim-a3e914b64c621605f91d7284f3050f7fed57a856.zip |
Merge pull request #14507 from fsouza/add-test-for-jumplist-fix
lsp: add a test for the jump_to_location + jump list fix
-rw-r--r-- | test/functional/plugin/lsp_spec.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua index 6eda515fb6..2b7198bf63 100644 --- a/test/functional/plugin/lsp_spec.lua +++ b/test/functional/plugin/lsp_spec.lua @@ -1895,6 +1895,17 @@ describe('LSP', function() eq('å', exec_lua[[return vim.fn.expand('<cword>')]]) end) + it('adds current position to jumplist before jumping', function() + exec_lua([[ + vim.api.nvim_win_set_buf(0, ...) + vim.api.nvim_win_set_cursor(0, {2, 0}) + ]], default_target_bufnr) + jump(default_target_bufnr, location(default_target_uri, 0, 9, 0, 9)) + + local mark = exec_lua([[return vim.inspect(vim.api.nvim_buf_get_mark(..., "'"))]], default_target_bufnr) + eq('{ 2, 0 }', mark) + end) + it('should not push item to tagstack if destination is the same as source', function() -- Set cursor at the 2nd line, 1st character. This is the source position -- for the test, and will also be the destination one, making the cursor |