Opening a new tab in a plugin #3850
-
|
Hi, I am trying to create a new tab in a plugin but I can't figure out how. I have tried this but I get the following error I don't see the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The local config = import("micro/config")
function init()
config.MakeCommand("createTab", createTabCommand, config.NoComplete)
end
function createTabCommand(bp)
bp:NewTabCmd({"/home/jordo/test.md"})
endI’m not sure what your final goal is. If you just want to create a tab from a filepath, there’s already the command |
Beta Was this translation helpful? Give feedback.
The
actionpackage is not exported.NewTabFromBufferis not accessible from Lua, and there is no intended way to create a new tab directly. You can create one throughfunc (h *BufPane) NewTabCmd(args []string).I’m not sure what your final goal is. If you just want to create a tab from a filepath, there’s already the command
tab [filepath]. If you want to bind it to a key, you can do …