feat(customization): icons config, PendingTab, and demo infrastructure (#46)
* feat(config): add icons table with unicode defaults * feat(buffer): render icon overlays from config.icons Problem: status characters ([ ], [x], [!]) and metadata prefixes are hardcoded literals with no user customization. Solution: read config.icons in apply_extmarks and apply overlay extmarks for checkboxes/headers, replace hardcoded recur ↺ with icons.recur, and prefix due/category virt_text with configurable icon characters. * feat(plugin): add PendingTab command and <Plug>(pending-tab) * docs: add icons config, PendingTab recipes, and demo infrastructure Problem: icon customization and auto-start workflow are undocumented; no demo asset exists for the README. Solution: document pending.Icons in vimdoc with nerd font and ASCII recipes, add PendingTab to commands and mappings, add open-on-startup recipe, add demo-init.lua and demo.tape for VHS screenshot generation, add assets/ directory, add README icons section and demo placeholder. * ci: format
This commit is contained in:
parent
a2e0e296ac
commit
dbd76d6759
9 changed files with 248 additions and 4 deletions
59
spec/icons_spec.lua
Normal file
59
spec/icons_spec.lua
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
require('spec.helpers')
|
||||
|
||||
local config = require('pending.config')
|
||||
|
||||
describe('icons', function()
|
||||
before_each(function()
|
||||
vim.g.pending = nil
|
||||
config.reset()
|
||||
end)
|
||||
|
||||
after_each(function()
|
||||
vim.g.pending = nil
|
||||
config.reset()
|
||||
end)
|
||||
|
||||
it('has default icon values', function()
|
||||
local icons = config.get().icons
|
||||
assert.equals('○', icons.pending)
|
||||
assert.equals('✓', icons.done)
|
||||
assert.equals('●', icons.priority)
|
||||
assert.equals('▸', icons.header)
|
||||
assert.equals('·', icons.due)
|
||||
assert.equals('↺', icons.recur)
|
||||
assert.equals('#', icons.category)
|
||||
end)
|
||||
|
||||
it('allows overriding individual icons', function()
|
||||
vim.g.pending = { icons = { pending = '-', done = 'x' } }
|
||||
config.reset()
|
||||
local icons = config.get().icons
|
||||
assert.equals('-', icons.pending)
|
||||
assert.equals('x', icons.done)
|
||||
assert.equals('●', icons.priority)
|
||||
assert.equals('▸', icons.header)
|
||||
end)
|
||||
|
||||
it('allows overriding all icons', function()
|
||||
vim.g.pending = {
|
||||
icons = {
|
||||
pending = '-',
|
||||
done = 'x',
|
||||
priority = '!',
|
||||
header = '>',
|
||||
due = '@',
|
||||
recur = '~',
|
||||
category = '+',
|
||||
},
|
||||
}
|
||||
config.reset()
|
||||
local icons = config.get().icons
|
||||
assert.equals('-', icons.pending)
|
||||
assert.equals('x', icons.done)
|
||||
assert.equals('!', icons.priority)
|
||||
assert.equals('>', icons.header)
|
||||
assert.equals('@', icons.due)
|
||||
assert.equals('~', icons.recur)
|
||||
assert.equals('+', icons.category)
|
||||
end)
|
||||
end)
|
||||
Loading…
Add table
Add a link
Reference in a new issue