blob: 03238df86d22c799f4e9c0e977267806a52739a0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
local config = import 'micro/config'
local function wantwords(ft)
return ft == 'markdown'
or ft == 'asciidoc'
end
local function appendsep(s, a)
if s ~= '' then s = s .. ' | ' end
return s .. a
end
function onBufferOpen(b)
if wantwords(b:FileType()) then
local format = config.GetGlobalOption 'statusformatr'
local add = '$(textcount.words) Words'
if not string.find(format, add) then
b:SetOption('statusformatr', appendsep(format, add))
end
end
end
|