Skip to content

Commit

Permalink
fix(commands): rename server to web
Browse files Browse the repository at this point in the history
  • Loading branch information
neo451 committed Feb 26, 2025
1 parent b21ed61 commit b642e64
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions lua/feed/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ local feedlist = ut.feedlist

local M = {}

M.server = {
doc = "opens server",
M.web = {
doc = "opens server and web interface",
impl = function(port)
port = port or Config.web.port
require("feed.server").open(port)
Expand Down
26 changes: 14 additions & 12 deletions lua/feed/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ local redo_history = state.redo_history
local hl = vim.hl or vim.highlight
local api, fn, fs = vim.api, vim.fn, vim.fs

local og = {}

local M = {
state = state,
}
Expand Down Expand Up @@ -87,6 +85,19 @@ local body_transforms = {
-- TODO: allow user
}

local function hl_entry(buf)
for i, t in ipairs({
{ 7, "FeedTitle" },
{ 8, "FeedAuthor" },
{ 6, "FeedFeed" },
{ 6, "FeedLink" },
{ 6, "FeedDate" },
}) do
local j, hi = t[1], t[2]
hl.range(buf, ns_entry, hi, { i - 1, j }, { i - 1, 200 })
end
end

---@param buf integer
---@param body string
---@param id string
Expand Down Expand Up @@ -128,18 +139,9 @@ local function render_entry(buf, body, id)
api.nvim_buf_set_lines(buf, i - 1, i, false, { v })
end

for i, t in ipairs({
{ 7, "FeedTitle" },
{ 8, "FeedAuthor" },
{ 6, "FeedFeed" },
{ 6, "FeedLink" },
{ 6, "FeedDate" },
}) do
local j, hi = t[1], t[2]
hl.range(buf, ns_entry, hi, { i - 1, j }, { i - 1, 200 })
end
vim.bo[buf].modifiable = false

hl_entry(buf)
image_attach(buf)
mark_read(id)

Expand Down

0 comments on commit b642e64

Please sign in to comment.