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

Invalid 'end_col': out of range error whenever running Neogen file #162

Open
yann-qu opened this issue Jan 5, 2024 · 2 comments
Open

Invalid 'end_col': out of range error whenever running Neogen file #162

yann-qu opened this issue Jan 5, 2024 · 2 comments

Comments

@yann-qu
Copy link

yann-qu commented Jan 5, 2024

Whenever I run the command Neogen file to generate comment for the entire file, I get the following error message if the file's first line is blank:

E5108: Error executing lua ...e/yann/.local/share/nvim/lazy/neogen/lua/neogen/mark.lua:72: Invalid 'end_col': out of range
stack traceback:
        [C]: in function 'nvim_buf_set_extmark'
        ...e/yann/.local/share/nvim/lazy/neogen/lua/neogen/mark.lua:72: in function 'add_range_mark'
        ...n/.local/share/nvim/lazy/neogen/lua/neogen/generator.lua:358: in function 'generate'
        [string ":lua"]:1: in main chunk
Press ENTER or type command to continue

If I press the key ENTER, the comment will still be generated successfully, but the error message is really annoying.

Code example which generates error message when I run the command Neogen file:
image

Code example which works fine when I run the command Neogen file:
image

Neogen version:

branch main
commit 70127ba

Neovim version:

NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1692716794

OS: Ubuntu 20.04 in wsl2

I know it's a really small and insignificant problem, but I'll be really grateful if you could help me.

@KnBrckr
Copy link

KnBrckr commented Jan 7, 2024

I'm seeing the same issue with neogen:

tag     2.15.2
branch  main
commit  cb1f384

Neovim version:

NVIM v0.9.4
Build type: Release
LuaJIT 2.1.1703358377

@ssiyad
Copy link
Contributor

ssiyad commented Jan 22, 2024

mark:add_range_mark({ row, 0, row + #template_content, 1 })

I tried to replace 1 with 0 and it works fine. I don't actually know what the issue is but it might be related to nvim_buf_set_extmark.

Also, lsp throws some warnings in this code block
image
@danymat

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

No branches or pull requests

3 participants