Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid goto logic in internal.lua #208

Merged
merged 1 commit into from
Feb 4, 2022
Merged

Avoid goto logic in internal.lua #208

merged 1 commit into from
Feb 4, 2022

Conversation

sainnhe
Copy link
Contributor

@sainnhe sainnhe commented Feb 3, 2022

The goto keyword is introduced in a newer version of lua, running this
plugin with an older version of lua will produce an error:

Error detected while processing function matchup#loader#bufwinenter[4]..matchup#loader#init_buffer[5]..matchup#ts_engine#is_enabled[4]..<SNR>126_forward:
line    1:
E5108: Error executing lua vim.lua:63: ...local/share/nvim/plugins/vim-matchup/lua/treesitter-matchup/internal.lua:195: '=' expected near 'continue'
stack traceback:
        [C]: in function 'error'
        vim.lua:63: in function <vim.lua:57>
        [C]: in function 'require'
        [string "luaeval()"]:1: in main chunk
Error detected while processing function matchup#loader#bufwinenter[4]..matchup#loader#init_buffer[15]..matchup#ts_engine#is_hl_enabled[4]..<SNR>126_forward:
line    1:
E5108: Error executing lua vim.lua:63: ...local/share/nvim/plugins/vim-matchup/lua/treesitter-matchup/internal.lua:195: '=' expected near 'continue'
stack traceback:
        [C]: in function 'error'
        vim.lua:63: in function <vim.lua:57>
        [C]: in function 'require'
        [string "luaeval()"]:1: in main chunk
Error detected while processing function matchup#loader#init_buffer[5]..matchup#ts_engine#is_enabled[4]..<SNR>126_forward:
line    1:
E5108: Error executing lua vim.lua:63: ...local/share/nvim/plugins/vim-matchup/lua/treesitter-matchup/internal.lua:195: '=' expected near 'continue'
stack traceback:
        [C]: in function 'error'
        vim.lua:63: in function <vim.lua:57>
        [C]: in function 'require'
        [string "luaeval()"]:1: in main chunk

This commit removes the goto keyword to avoid such error. Has been
tested on debian testing.

Related: AaronJackson/vrn#157

The `goto` keyword is introduced in a newer version of lua, running this
plugin with an older version of lua will produce an error:

```
Error detected while processing function matchup#loader#bufwinenter[4]..matchup#loader#init_buffer[5]..matchup#ts_engine#is_enabled[4]..<SNR>126_forward:
line    1:
E5108: Error executing lua vim.lua:63: ...local/share/nvim/plugins/vim-matchup/lua/treesitter-matchup/internal.lua:195: '=' expected near 'continue'
stack traceback:
        [C]: in function 'error'
        vim.lua:63: in function <vim.lua:57>
        [C]: in function 'require'
        [string "luaeval()"]:1: in main chunk
Error detected while processing function matchup#loader#bufwinenter[4]..matchup#loader#init_buffer[15]..matchup#ts_engine#is_hl_enabled[4]..<SNR>126_forward:
line    1:
E5108: Error executing lua vim.lua:63: ...local/share/nvim/plugins/vim-matchup/lua/treesitter-matchup/internal.lua:195: '=' expected near 'continue'
stack traceback:
        [C]: in function 'error'
        vim.lua:63: in function <vim.lua:57>
        [C]: in function 'require'
        [string "luaeval()"]:1: in main chunk
Error detected while processing function matchup#loader#init_buffer[5]..matchup#ts_engine#is_enabled[4]..<SNR>126_forward:
line    1:
E5108: Error executing lua vim.lua:63: ...local/share/nvim/plugins/vim-matchup/lua/treesitter-matchup/internal.lua:195: '=' expected near 'continue'
stack traceback:
        [C]: in function 'error'
        vim.lua:63: in function <vim.lua:57>
        [C]: in function 'require'
        [string "luaeval()"]:1: in main chunk
```

This commit removes the goto keyword to avoid such error. Has been
tested on debian testing.

Related: AaronJackson/vrn#157
@andymass
Copy link
Owner

andymass commented Feb 3, 2022 via email

@sainnhe
Copy link
Contributor Author

sainnhe commented Feb 3, 2022

I honestly don't know what happened, I installed neovim on debian testing and this plugin breaks.

This is my Dockerfile.

@andymass andymass merged commit 0fd7055 into andymass:master Feb 4, 2022
@andymass
Copy link
Owner

andymass commented Feb 4, 2022

I don't fully understand, but the change is reasonable. Merged, thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants