diff options
| author | Brady Phillips <brady.phillips99@gmail.com> | 2021-03-20 03:05:20 +0000 |
|---|---|---|
| committer | Kiyan <yazdani.kiyan@protonmail.com> | 2021-03-22 17:36:19 +0100 |
| commit | bdbae28b247a15ea8d162de4f62d5e35bcf9c8d9 (patch) | |
| tree | 42450ca94b32510015a7df01a3af5691d61433de /lua | |
| parent | Update lockfile.json (diff) | |
| download | nvim-treesitter-bdbae28b247a15ea8d162de4f62d5e35bcf9c8d9.tar nvim-treesitter-bdbae28b247a15ea8d162de4f62d5e35bcf9c8d9.tar.gz nvim-treesitter-bdbae28b247a15ea8d162de4f62d5e35bcf9c8d9.tar.bz2 nvim-treesitter-bdbae28b247a15ea8d162de4f62d5e35bcf9c8d9.tar.lz nvim-treesitter-bdbae28b247a15ea8d162de4f62d5e35bcf9c8d9.tar.xz nvim-treesitter-bdbae28b247a15ea8d162de4f62d5e35bcf9c8d9.tar.zst nvim-treesitter-bdbae28b247a15ea8d162de4f62d5e35bcf9c8d9.zip | |
Fix indent size
Indent size should equal shiftwidth, unless shiftwidth is 0 in which
case tabstop should be used.
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim-treesitter/indent.lua | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lua/nvim-treesitter/indent.lua b/lua/nvim-treesitter/indent.lua index 7bd97b86d..cdbf66489 100644 --- a/lua/nvim-treesitter/indent.lua +++ b/lua/nvim-treesitter/indent.lua @@ -39,10 +39,6 @@ local get_indents = utils.memoize_by_buf_tick(function(bufnr) } end) -local function get_indent_size() - return vim.bo.softtabstop > 0 and vim.bo.shiftwidth or vim.bo.tabstop -end - function M.get_indent(lnum) local parser = parsers.get_parser() if not parser or not lnum then return -1 end @@ -52,7 +48,7 @@ function M.get_indent(lnum) local node = get_node_at_line(root, lnum-1) local indent = 0 - local indent_size = get_indent_size() + local indent_size = vim.fn.shiftwidth() -- to get corret indetation when we land on an empty line (for instance by typing `o`), we try -- to use indentation of previous nonblank line, this solves the issue also for languages that |
