From 0246f1a897f4c349760cec9aea6db8bdd71bf3c5 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 28 Feb 2024 18:01:38 +0100 Subject: [PATCH] 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`. --- runtime/plugin/tohtml.lua | 1 + 1 file changed, 1 insertion(+) 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 = '?' })