22 lines
603 B
Lua
22 lines
603 B
Lua
local M = require("lualine.fschauen.component"):extend()
|
|
|
|
function M:init(opts)
|
|
opts.color = opts.color or { bg = "#d65d0e" }
|
|
opts.cond = opts.cond or function() return vim.bo.filetype ~= "help" end
|
|
M.super.init(self, opts)
|
|
end
|
|
|
|
function M:update_status(--[[is_focused]]_)
|
|
local trailing = [[\s\+$]]
|
|
local lineno = vim.fn.search(trailing, "nwc")
|
|
if lineno == 0 then return "" end
|
|
|
|
local result = " " .. lineno
|
|
|
|
local total = vim.fn.searchcount({ pattern = trailing }).total
|
|
if total > 1 then result = result .. string.format(" (%d total)", total) end
|
|
|
|
return result
|
|
end
|
|
|
|
return M
|