aboutsummaryrefslogtreecommitdiff
path: root/plugins/ghmarkdown.lua
diff options
context:
space:
mode:
authorGuldoman <giulio.lettieri@gmail.com>2022-11-02 08:10:57 +0100
committerGitHub <noreply@github.com>2022-11-02 08:10:57 +0100
commit9bf5649c7df6bbd746956e9a96b616f61a59fa9b (patch)
tree725e2d12dc826f8ebe73807a705371cb4c5af4d9 /plugins/ghmarkdown.lua
parent49139e03398c9d0ecb347267a4882a4eb3f7ee23 (diff)
downloadlite-xl-plugins-9bf5649c7df6bbd746956e9a96b616f61a59fa9b.tar.gz
lite-xl-plugins-9bf5649c7df6bbd746956e9a96b616f61a59fa9b.zip
Use new `command.add` syntax (#136)
Diffstat (limited to 'plugins/ghmarkdown.lua')
-rw-r--r--plugins/ghmarkdown.lua6
1 files changed, 2 insertions, 4 deletions
diff --git a/plugins/ghmarkdown.lua b/plugins/ghmarkdown.lua
index 244b144..c7fabdd 100644
--- a/plugins/ghmarkdown.lua
+++ b/plugins/ghmarkdown.lua
@@ -40,10 +40,8 @@ local html = [[
]]
-command.add("core.docview", {
- ["ghmarkdown:show-preview"] = function()
- local dv = core.active_view
-
+command.add("core.docview!", {
+ ["ghmarkdown:show-preview"] = function(dv)
local content = dv.doc:get_text(1, 1, math.huge, math.huge)
local esc = { ['"'] = '\\"', ["\n"] = '\\n' }
local text = html:gsub("${(.-)}", {