Closed tlarevo closed 1 year ago
This is also happening for C haven't tried other language yet.
This was happening in all languages. It should now be resolved.
@filNaj Thanks a lot for the effort put in to the plugin, if time permits can you explain how, how adding return
fixed the issue. I tried fixing the issue myself and couldn't find out the root cause. I'm noob on lua and neovim plugin dev but I would like to learn and contribute whenever possible.
Adding return
prevents the code to continue any further and reach the if statement
at the end of the setter.lua file. This if statement
is used to insert a ;
when the user presses on the enter
key (and not the space bar) to go to the next line. This is done by calling vim.api.nvim_buf_set_lines()
function. But in the if character == ':'
block, we are already calling this same function but with different arguments. So by adding the return
, we prevent the vim.api.nvim_buf_set_lines()
to be called twice.
Hope that helps.
@filNaj thanks a lot for taking time to explain, it makes sense now, I didn't know that with lua you can return without any value. Thanks a lot explaining the scenario 🙏 ❤️
Bug preview
Context
I'm using NvChad and my
treesitter
config as follows;