Closed Jeaciaz closed 1 year ago
Thanks for the feedback!
I've added a fix to the PR #5, but I won't merge it into the main for now because I found a few things that go against the concept of the plugin. (in cases where there are no separators like a comma between siblings on different lines, as is the case with jsx
and html
). For now, you can use PR #5.
To move attributes, now you need to set the option "interline_swaps_witout_separator" to true
Hi, thank you for the plugin! It feels really good, however the swapping of JSX props doesn't work when they're on separate lines, even with
allow_interline_swaps
enabled:Edit: for clarity, it works perfectly when the attributes are on the same line.
My packer and treesitter setup:
```lua use { 'Wansmer/sibling-swap.nvim', requires = { 'nvim-treesitter' }, config = function () require'sibling-swap'.setup {} end } use { 'Wansmer/sibling-swap.nvim', requires = { 'nvim-treesitter' }, config = function () require'sibling-swap'.setup {} end } -- in a separate file local status, ts = pcall(require, 'nvim-treesitter.configs') if (not status) then return end ts.setup { highlight = { enable = true, disable = {} }, indent = { enable = true, disable = {} }, ensure_installed = { "markdown", "markdown_inline", "lua", "tsx", "json", "yaml", "css", "html", }, autotag = { enable = true }, context_commentstring = { config = { javascript = { __default = '// %s', jsx_element = '{/*%s*/}', jsx_fragment = '{/*%s*/}', jsx_attribute = '// %s', comment = '// %s' }, typescript = { __default = '// %s', __multiline = '/* %s */' } } } } local parser_config = require 'nvim-treesitter.parsers'.get_parser_configs() parser_config.tsx.filetype_to_parsername = { "javascript", "typescript.tsx" } ```