We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ab699f commit ff2e6b7Copy full SHA for ff2e6b7
1 file changed
lua/csvtools/header.lua
@@ -5,17 +5,19 @@ local M = {}
5
function M.Header()
6
local line = unpack(vim.api.nvim_buf_get_lines(0, 0, 1, true))
7
local header = {}
8
- local cout = 1
9
local length = 0
10
for i = 1, #line do
11
if line:sub(i, i) ~= "," then
12
length = length + 1
13
else
14
table.insert(header, length)
15
length = 0
16
- cout = cout + 1
17
end
18
+ -- fixbug
+ if length ~= 0 then
19
+ table.insert(header, length)
20
+ end
21
return header
22
23
return M
0 commit comments