From 559ef194b762c73aab0839a36f0b348cda1682aa Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Fri, 6 Mar 2026 08:40:43 -0500 Subject: [PATCH] refactor(parser): expose `get_lang_from_ft` as public API Problem: `get_lang_from_ft` is needed by the gitsigns module but was a local function in `parser.lua`, causing duplication. Solution: assign it to `M.get_lang_from_ft` for reuse by other modules. --- lua/diffs/parser.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/diffs/parser.lua b/lua/diffs/parser.lua index ccbd46a..aa63daf 100644 --- a/lua/diffs/parser.lua +++ b/lua/diffs/parser.lua @@ -353,6 +353,8 @@ function M.parse_buffer(bufnr) return hunks end +M.get_lang_from_ft = get_lang_from_ft + M._test = { ft_lang_cache = ft_lang_cache, }