mirror of
https://github.com/halfdan/dotfiles.git
synced 2025-04-27 04:45:38 +00:00
14 lines
301 B
Lua
14 lines
301 B
Lua
local M = {}
|
|
|
|
function M.is_buffer_empty()
|
|
-- Check whether the current buffer is empty
|
|
return vim.fn.empty(vim.fn.expand('%:t')) == 1
|
|
end
|
|
|
|
function M.has_width_gt(cols)
|
|
-- Check if the windows width is greater than a given number of columns
|
|
return vim.fn.winwidth(0) / 2 > cols
|
|
end
|
|
|
|
return M
|