Skip to content

Commit ff2e6b7

Browse files
author
cht
committed
fix the problem of last head cannot git
1 parent 4ab699f commit ff2e6b7

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lua/csvtools/header.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@ local M = {}
55
function M.Header()
66
local line = unpack(vim.api.nvim_buf_get_lines(0, 0, 1, true))
77
local header = {}
8-
local cout = 1
98
local length = 0
109
for i = 1, #line do
1110
if line:sub(i, i) ~= "," then
1211
length = length + 1
1312
else
1413
table.insert(header, length)
1514
length = 0
16-
cout = cout + 1
1715
end
1816
end
17+
-- fixbug
18+
if length ~= 0 then
19+
table.insert(header, length)
20+
end
1921
return header
2022
end
2123
return M

0 commit comments

Comments
 (0)