Skip to content

Commit 3951716

Browse files
committed
chore: Task View formatting
1 parent bfe8313 commit 3951716

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

lua/neorg-extras/modules/buff-man.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ M.win = nil
99
M.default_winopts = {
1010
{ "wrap", nil },
1111
{ "conceallevel", nil },
12-
{ "foldlevel", nil },
1312
{ "number", nil },
1413
{ "relativenumber", nil },
1514
}
@@ -70,7 +69,6 @@ function M.create_view_buffer(buffer_lines)
7069
vim.api.nvim_set_option_value("readonly", true, { buf = M.buf })
7170
vim.api.nvim_set_option_value("wrap", false, { win = M.win })
7271
vim.api.nvim_set_option_value("conceallevel", 2, { win = M.win })
73-
vim.api.nvim_set_option_value("foldlevel", 999, { win = M.win })
7472
vim.api.nvim_set_option_value("number", false, { win = M.win })
7573
vim.api.nvim_set_option_value("relativenumber", false, { win = M.win })
7674

lua/neorg-extras/neorg-agenda.lua

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ function M.day_view()
7070
table.insert(buffer_lines, "")
7171
table.insert(buffer_lines, "___")
7272
table.insert(buffer_lines, "* Today's Schedule")
73-
table.insert(buffer_lines, " /" .. os.date("%A", os.time(timetable)) .. "/ == /" .. year ..
74-
"-" .. month .. "-" .. day .. "/ == /wk" .. os.date("%U", os.time(timetable)) .. "/")
73+
table.insert(buffer_lines, " " .. os.date("%A", os.time(timetable)) .. " == " .. year ..
74+
"-" .. month .. "-" .. day .. " == wk" .. os.date("%U", os.time(timetable)))
7575
table.insert(buffer_lines, "___")
7676
table.insert(buffer_lines, "")
7777
table.insert(buffer_lines, "")
@@ -192,16 +192,17 @@ function M.day_view()
192192

193193
local task_str = "\\[" .. task.state .. "\\] " .. (task.task):match("%)%s*(.+)")
194194

195-
local priority_str = ""
195+
local priority_str = " "
196196
if task.priority ~= "" and task.priority ~= nil then
197-
priority_str = "/" .. task.priority .. "/"
197+
priority_str = priority_str .. "*" .. task.priority .. "*"
198+
else
199+
priority_str = priority_str .. " "
198200
end
201+
priority_str = priority_str .. " "
199202

200203
local line_str = " " .. deadline_str
201-
if priority_str ~= "" then
202-
line_str = line_str .. " :: " .. priority_str
203-
end
204-
line_str = line_str .. " :: " .. task_str
204+
line_str = line_str .. " ::" .. priority_str
205+
line_str = line_str .. ":: " .. task_str
205206
if tags_str ~= "" then
206207
line_str = line_str .. " :: " .. tags_str
207208
end
@@ -267,16 +268,17 @@ function M.day_view()
267268

268269
local task_state_str = "\\[" .. task.state .. "\\] " .. (task.task):match("%)%s*(.+)")
269270

270-
local priority_str = ""
271-
if task.priority and task.priority ~= "" then
272-
priority_str = "/" .. task.priority .. "/"
271+
local priority_str = " "
272+
if task.priority ~= "" and task.priority ~= nil then
273+
priority_str = priority_str .. "*" .. task.priority .. "*"
274+
else
275+
priority_str = priority_str .. " "
273276
end
277+
priority_str = priority_str .. " "
274278

275279
local line_str = " " .. time_str
276-
if priority_str ~= "" then
277-
line_str = line_str .. " :: " .. priority_str
278-
end
279-
line_str = line_str .. " :: " .. task_state_str
280+
line_str = line_str .. " ::" .. priority_str
281+
line_str = line_str .. ":: " .. task_state_str
280282
if tags_str ~= "" then
281283
line_str = line_str .. " :: " .. tags_str
282284
end
@@ -309,11 +311,11 @@ function M.day_view()
309311
for _, task in ipairs(miscellaneous) do
310312
local unscheduled_str = "*"
311313
unscheduled_str = unscheduled_str ..
312-
"{:" .. task.filename .. ":" .. string.gsub(task.task, "%b()", "") .. "}[unscheduled]*"
314+
"{:" .. task.filename .. ":" .. string.gsub(task.task, "%b()", "") .. "}[unscheduled]*"
313315

314316
local task_str = "\\[" .. task.state .. "\\] " .. (task.task):match("%)%s*(.+)")
315317
local tags_str = "`untagged`"
316-
local priority_str = "/unprioritised/"
318+
local priority_str = "*unprioritised*"
317319
local line_str = " " .. unscheduled_str
318320
line_str = line_str .. " :: " .. priority_str
319321
line_str = line_str .. " :: " .. task_str

0 commit comments

Comments
 (0)