show executable status in the statusbar
This commit is contained in:
@ -308,4 +308,18 @@ function M.line(opts)
|
||||
end)
|
||||
end
|
||||
|
||||
function M.fn_tail(opts)
|
||||
opts = opts or {}
|
||||
local fmt = opts.fmt or "%s"
|
||||
local hl_exec = opts.hl_exec or "Character"
|
||||
|
||||
local fn = vim.fn.expand("%:t")
|
||||
if vim.fn.getftype(fn) == "file" then
|
||||
if string.match(vim.fn.getfperm(fn), 'x', 3) then
|
||||
return (fmt):format(set_hl(hl_exec, fn))
|
||||
end
|
||||
end
|
||||
return (fmt):format(fn)
|
||||
end
|
||||
|
||||
return M
|
||||
|
Reference in New Issue
Block a user