diff --git a/lua/fittencode/actions/identify_programming_language.lua b/lua/fittencode/actions/identify_programming_language.lua index 69c75ed..a016a7c 100644 --- a/lua/fittencode/actions/identify_programming_language.lua +++ b/lua/fittencode/actions/identify_programming_language.lua @@ -4,6 +4,7 @@ local API = require('fittencode.api').api local Base = require('fittencode.base') local Config = require('fittencode.config') local Log = require('fittencode.log') +local Status = require('fittencode.status') local M = {} @@ -16,6 +17,10 @@ local IPL_DEBOUNCE_TIME = 1000 local ipl_timer = nil local function _identify_current_buffer() + local inline = API.get_current_status() + if inline == Status.C.GENERATING then + return + end local buffer = api.nvim_get_current_buf() local name = api.nvim_buf_get_name(buffer) local ext = vim.fn.fnamemodify(name, ':e') diff --git a/lua/fittencode/status.lua b/lua/fittencode/status.lua index 8086171..5fca0a8 100644 --- a/lua/fittencode/status.lua +++ b/lua/fittencode/status.lua @@ -13,9 +13,7 @@ local Log = require('fittencode.log') ---@field get_current function local M = {} ----@alias StatusCodes table - ----@type StatusCodes +---@class StatusCodes local C = { DISABLED = 1, IDLE = 2, @@ -25,7 +23,8 @@ local C = { SUGGESTIONS_READY = 6, } -M.C = C +---@type StatusCodes +M.C = vim.deepcopy(C) function M:new(opts) local obj = {