From 31673306d6dd8116f3902e2026920f2c9e373e60 Mon Sep 17 00:00:00 2001 From: "Wansmer (Ivan Smirnov)" Date: Sat, 23 Nov 2024 11:58:51 +0300 Subject: [PATCH 1/2] fix: disable expandtab for go --- tests/minimal.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/minimal.lua b/tests/minimal.lua index d2aadfc..0c157fd 100644 --- a/tests/minimal.lua +++ b/tests/minimal.lua @@ -36,6 +36,14 @@ for _, plugin in ipairs(dependencies) do install_dep(plugin) end +vim.api.nvim_create_autocmd('FileType', { + callback = function() + if vim.bo.filetype == 'go' then + vim.bo.expandtab = false + end + end, +}) + require('plenary.busted') require('nvim-treesitter.configs').setup({ ensure_installed = require('treesj.langs').configured_langs, From db5ed9834b13ec4428014cdbc99ccd8f50de851c Mon Sep 17 00:00:00 2001 From: "Wansmer (Ivan Smirnov)" Date: Sat, 23 Nov 2024 12:02:49 +0300 Subject: [PATCH 2/2] feat: add trailing comma to python's parameters --- lua/treesj/langs/python.lua | 4 +++- tests/sample/index.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/treesj/langs/python.lua b/lua/treesj/langs/python.lua index b2de4eb..1c46663 100644 --- a/lua/treesj/langs/python.lua +++ b/lua/treesj/langs/python.lua @@ -83,7 +83,9 @@ return { }, }), argument_list = lang_utils.set_preset_for_args(), - parameters = lang_utils.set_preset_for_args(), + parameters = lang_utils.set_preset_for_args({ + split = { last_separator = true }, + }), parenthesized_expression = lang_utils.set_preset_for_args({}), list_comprehension = lang_utils.set_preset_for_args(), set_comprehension = lang_utils.set_preset_for_args(), diff --git a/tests/sample/index.py b/tests/sample/index.py index 7c9553a..18a7171 100644 --- a/tests/sample/index.py +++ b/tests/sample/index.py @@ -54,7 +54,7 @@ def adder(y): # RESULT OF SPLIT (node "parameters" and "function_definition", preset default) def create_adder( x, - b + b, ): def adder(y): return x + y