nicer formatting

This commit is contained in:
Yannick Reiß 2024-02-19 16:42:07 +01:00
parent 41862d5150
commit afa326e426
No known key found for this signature in database
GPG Key ID: 5A3AF456F0A0338C
1 changed files with 9 additions and 27 deletions

View File

@ -148,22 +148,6 @@ function M.lookup()
b = y b = y
end end
-- select descriptions from rss_content
b = b_start
local descriptions = {}
while true do
local x, y = rss_content:find("<description>.-</description>", b, false)
-- stop if no further occurrences are found
if x == nil or y == nil then
break
end
-- save substring to descriptions
table.insert(descriptions, rss_content:sub(x + 12, y - 13))
b = y
end
api.nvim_buf_set_lines(buf, 1, -1, false, { api.nvim_buf_set_lines(buf, 1, -1, false, {
" Found entries: " .. #dates, " Found entries: " .. #dates,
}) })
@ -174,8 +158,6 @@ function M.lookup()
current_line = current_line + 1 current_line = current_line + 1
api.nvim_buf_set_lines(buf, current_line, -1, false, { " Date: " .. dates[x] }) api.nvim_buf_set_lines(buf, current_line, -1, false, { " Date: " .. dates[x] })
current_line = current_line + 1 current_line = current_line + 1
api.nvim_buf_set_lines(buf, current_line, -1, false, { "Description: " .. descriptions[x] })
current_line = current_line + 1
api.nvim_buf_set_lines(buf, current_line, -1, false, { " Website: " .. links[x] }) api.nvim_buf_set_lines(buf, current_line, -1, false, { " Website: " .. links[x] })
current_line = current_line + 1 current_line = current_line + 1
api.nvim_buf_set_lines(buf, current_line, -1, false, { "" }) api.nvim_buf_set_lines(buf, current_line, -1, false, { "" })