Skip to content

Conversation

@ervandew
Copy link

@ervandew ervandew commented Jun 20, 2025

when attempting to align an empty file, align_csv will try to look for a non-blank line, but in doing so it will pull from the lines array using the length + 1, leading to an error:

lua/decisive.lua:64: attempt to get length of local 'test_line' (a nil value)

This is in the context of an autocmd like so:

vim.api.nvim_create_autocmd('BufWinEnter', {
  pattern = '*.csv',
  callback = function()
    local decisive = require('decisive')
    decisive.setup({})
    decisive.align_csv({ csv_separator = ',' })
  end
})

Where the error occurs when that autocmd fires on a new csv buffer that has no content.

when attempting to align an empty file, align_csv will try to look for a non-blank line, but in doing so it will pull from the lines array using the length + 1, leading to an error:

lua/decisive.lua:64: attempt to get length of local 'test_line' (a nil value)
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.

1 participant