Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/frontline/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ function M.refresh_current_buffer(task_hash)
if task_hash then
local bufnr = vim.api.nvim_get_current_buf()
local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)
local search_str = "(" .. task_hash .. ")"
local search_str = "`" .. task_hash .. "`"
for lnum, line in ipairs(lines) do
if line:find(search_str, 1, true) then
if saved_pos and lnum ~= saved_pos[1] then
Expand Down
8 changes: 3 additions & 5 deletions lua/frontline/mappings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ function M.set_config(new_config)
end

-- Extract task hash from the current line
-- Expected format: * [status] description ... (hash)
-- Expected format: * [status] description ... `hash`
function M.get_task_hash_under_cursor()
local line = vim.api.nvim_get_current_line()

-- Match the hash pattern at the end: (xxxxxxxx)
local hash = string.match(line, "%(([a-f0-9]+)%)%s*$")
local hash = string.match(line, "`([a-f0-9]+)`")

if not hash then
vim.notify("No task hash found on current line", vim.log.levels.WARN)
Expand Down Expand Up @@ -974,8 +973,7 @@ function M.copy_task()
local description = task.description or "Unknown task"
local short_uuid = string.sub(task.uuid, 1, 8)

-- Format as "description (short_uuid)"
local text_to_copy = string.format("%s (%s)", description, short_uuid)
local text_to_copy = string.format("%s `%s`", description, short_uuid)

-- Copy to system clipboard (+ register)
vim.fn.setreg('+', text_to_copy)
Expand Down
2 changes: 1 addition & 1 deletion lua/frontline/renderer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ function M.format_task(task, convert_to_local, use_relative)
table.insert(parts, extra_icons_str)
end

table.insert(parts, string.format("(%s)", short_hash))
table.insert(parts, string.format("`%s`", short_hash))

return table.concat(parts, " ")
end
Expand Down