commit 0246f1a897f4c349760cec9aea6db8bdd71bf3c5
parent aa62898ae329ec7ef978b4e7263c6f41b28f2503
Author: Christian Clason <c.clason@uni-graz.at>
Date: Wed, 28 Feb 2024 18:01:38 +0100
fix(tohtml): set filetype of generated HTML to `html`
Problem: `:TOhtml` opens the generated HTML code in a split, meaning it
inherits the `help` filetype if a help buffer is to be converted.
Solution: Explicitly set the filetype to `html`.
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/runtime/plugin/tohtml.lua b/runtime/plugin/tohtml.lua
@@ -8,4 +8,5 @@ vim.api.nvim_create_user_command('TOhtml', function(args)
local html = require('tohtml').tohtml()
vim.fn.writefile(html, outfile)
vim.cmd.split(outfile)
+ vim.bo.filetype = 'html'
end, { bar = true, nargs = '?' })