diff --git a/lua/frontline/init.lua b/lua/frontline/init.lua index 2fd6ef8..7d21d90 100644 --- a/lua/frontline/init.lua +++ b/lua/frontline/init.lua @@ -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 diff --git a/lua/frontline/mappings.lua b/lua/frontline/mappings.lua index 190e32b..f759131 100644 --- a/lua/frontline/mappings.lua +++ b/lua/frontline/mappings.lua @@ -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) @@ -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) diff --git a/lua/frontline/renderer.lua b/lua/frontline/renderer.lua index 2d40b9f..e0dc374 100644 --- a/lua/frontline/renderer.lua +++ b/lua/frontline/renderer.lua @@ -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