diff --git a/data/plugins/contextmenu.lua b/data/plugins/contextmenu.lua index b84d114d..dc95567f 100644 --- a/data/plugins/contextmenu.lua +++ b/data/plugins/contextmenu.lua @@ -42,6 +42,24 @@ keymap.add { ["menu"] = "context:show" } +local function copy_log() + local item = core.active_view.hovered_item + if item then + system.set_clipboard(core.get_log(item)) + end +end + +local function open_as_doc() + local doc = core.open_doc("logs.txt") + core.root_view:open_doc(doc) + doc:insert(1, 1, core.get_log()) +end + +menu:register("core.logview", { + { text = "Copy entry", command = copy_log }, + { text = "Open as file", command = open_as_doc } +}) + if require("plugins.scale") then menu:register("core.docview", { { text = "Font +", command = "scale:increase" },