From d69122dbf3f340bd9f5dfbb55bef2f71ed65858d Mon Sep 17 00:00:00 2001 From: Shawon Date: Thu, 8 Aug 2024 14:21:52 +0600 Subject: [PATCH] fix(renderer): Added the filetype finding function to the code blocks renderer Ref: #72 --- lua/markview/languages.lua | 2 +- lua/markview/renderer.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/markview/languages.lua b/lua/markview/languages.lua index bb53b74..11a335f 100644 --- a/lua/markview/languages.lua +++ b/lua/markview/languages.lua @@ -266,7 +266,7 @@ languages.get_name = function (name) return string.gsub(name, "^%l", string.upper); end -languages.get_fs = function (name) +languages.get_ft = function (name) if not name or name == "" then return "Unknown"; elseif languages.reverse_map[name] then diff --git a/lua/markview/renderer.lua b/lua/markview/renderer.lua index 289bfd2..3914131 100644 --- a/lua/markview/renderer.lua +++ b/lua/markview/renderer.lua @@ -1052,8 +1052,8 @@ renderer.render_code_blocks = function (buffer, content, config_table) }) end elseif config_table.style == "language" then - local language = languages.get_fs(content.language); - local icon, hl = renderer.get_icon(content.language, config_table); + local language = languages.get_ft(content.language); + local icon, hl = renderer.get_icon(language, config_table); local block_length = content.largest_line; local languageName;