--- @return string
local function tab_info()
	local fname = vim.fn.expand("%:p")
	if fname == "" then
		return ""
	end
	return "%#WildMenu# " .. fname .. " %*"
end

--- @return string
local function filestatus()
	if vim.bo.modified == true then
		return "%#Error# ● %*"
	end
	if vim.bo.readonly == true then
		return "%#Error#   %*"
	end
	return ""
end

function _G.TabLine()
	return table.concat({
		tab_info(),
		filestatus(),
	})
end
vim.opt.tabline = "%!v:lua.TabLine()"
