add context menu options for logview
This commit is contained in:
parent
7c3daa0f39
commit
2fec3052ce
|
@ -42,6 +42,24 @@ keymap.add {
|
||||||
["menu"] = "context:show"
|
["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
|
if require("plugins.scale") then
|
||||||
menu:register("core.docview", {
|
menu:register("core.docview", {
|
||||||
{ text = "Font +", command = "scale:increase" },
|
{ text = "Font +", command = "scale:increase" },
|
||||||
|
|
Loading…
Reference in New Issue