Skip to content

Commit

Permalink
nit: add logging when editor window is too small
Browse files Browse the repository at this point in the history
  • Loading branch information
j-hui committed Jul 7, 2024
1 parent 43607ed commit 012a6a7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lua/fidget/notification/window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
---
--- Note that for now, it only supports editor-relative floats, though some code
--- ported from the legacy version still supports window-relative floats.
local M = {}
local M = {}
local logger = require("fidget.logger")

---@options notification.window [[
---@protected
--- Notifications window options
M.options = {
M.options = {
--- Base highlight group in the notification window
---
--- Used by any Fidget notification text that is not otherwise highlighted,
Expand Down Expand Up @@ -331,7 +332,7 @@ function M.get_window(row, col, anchor, width, height)
editor_width = math.max(0, editor_width - 4) -- HACK: guess width of signcolumn etc.

if editor_width < 4 or editor_height < 4 then
-- Editor is too small to render anything.
logger.info("Editor window is too small to display Fidget:", editor_width, "x", editor_height)
M.close()
return nil
end
Expand Down

0 comments on commit 012a6a7

Please sign in to comment.