aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2024-02-28 18:01:38 +0100
committerLewis Russell <me@lewisr.dev>2024-02-28 18:34:12 +0000
commit0246f1a897f4c349760cec9aea6db8bdd71bf3c5 (patch)
tree400ebf970cfb880b2c5f9ffd9a72f1a56602d4f0
parentaa62898ae329ec7ef978b4e7263c6f41b28f2503 (diff)
downloadrneovim-0246f1a897f4c349760cec9aea6db8bdd71bf3c5.tar.gz
rneovim-0246f1a897f4c349760cec9aea6db8bdd71bf3c5.tar.bz2
rneovim-0246f1a897f4c349760cec9aea6db8bdd71bf3c5.zip
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`.
-rw-r--r--runtime/plugin/tohtml.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/runtime/plugin/tohtml.lua b/runtime/plugin/tohtml.lua
index 893419ece6..79f2794a40 100644
--- 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 = '?' })