feat: error on invalid language

This commit is contained in:
Barrett Ruth 2025-10-24 01:21:54 -04:00
parent 48d4c6f113
commit c48cf384a4

View file

@ -306,8 +306,16 @@ function M.navigate_problem(direction, language)
require('cp.ui.views').disable()
end
if language then
local lang_result = config_module.get_language_for_platform(platform, language)
if not lang_result.valid then
logger.log(lang_result.error, vim.log.levels.ERROR)
return
end
end
local lang = language or get_current_file_language()
if lang then
if lang and not language then
local lang_result = config_module.get_language_for_platform(platform, lang)
if not lang_result.valid then
lang = nil