diff options
author | Hirokazu Hata <h.hata.ai.t@gmail.com> | 2020-06-27 11:27:51 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-27 11:27:51 +0900 |
commit | 7efb302d26abd863e2cbbf4d2d6f7bb4aa31cc29 (patch) | |
tree | 249ccd0759e4d61bdaea99f27e4e1c4ae965bbdc /test | |
parent | 225f0bcd98dd8ff8cab964f13816dfdf327038ae (diff) | |
parent | ebee9ebe2be2bd584efefc4064a8b3a07e0505e0 (diff) | |
download | rneovim-7efb302d26abd863e2cbbf4d2d6f7bb4aa31cc29.tar.gz rneovim-7efb302d26abd863e2cbbf4d2d6f7bb4aa31cc29.tar.bz2 rneovim-7efb302d26abd863e2cbbf4d2d6f7bb4aa31cc29.zip |
Merge pull request #12252 from dlukes/formatting-sync
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/plugin/lsp_spec.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua index c74ed6bf3b..4b12ea2557 100644 --- a/test/functional/plugin/lsp_spec.lua +++ b/test/functional/plugin/lsp_spec.lua @@ -1424,4 +1424,19 @@ describe('LSP', function() eq({15,5}, exec_lua[[ return {vim.lsp.util._make_floating_popup_size(contents,{width = 15, wrap_at = 14})} ]]) end) end) + + describe('lsp.util.get_effective_tabstop', function() + local function test_tabstop(tabsize, softtabstop) + exec_lua(string.format([[ + vim.api.nvim_buf_set_option(0, 'softtabstop', %d) + vim.api.nvim_buf_set_option(0, 'tabstop', 2) + vim.api.nvim_buf_set_option(0, 'shiftwidth', 3) + ]], softtabstop)) + eq(tabsize, exec_lua('return vim.lsp.util.get_effective_tabstop()')) + end + + it('with softtabstop = 1', function() test_tabstop(1, 1) end) + it('with softtabstop = 0', function() test_tabstop(2, 0) end) + it('with softtabstop = -1', function() test_tabstop(3, -1) end) + end) end) |