mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-19 15:53:07 +02:00
syntax: Improve color handling
This commit is contained in:
parent
7676f89a5a
commit
5440d21e83
2 changed files with 13 additions and 10 deletions
|
@ -1,9 +1,11 @@
|
|||
" Detect if conceal feature is available
|
||||
let s:conceal = exists("+conceallevel") ? ' conceal': ''
|
||||
|
||||
syntax match TaskWikiTask /\s*\* \[.\]\s.*$/
|
||||
|
||||
" Conceal the UUID
|
||||
execute 'syn match VimwikiTaskUuid containedin=VimwikiCheckBoxDone,VimwikiCheckBoxActive,VimwikiCheckBoxDeleted /\v#([A-Z]:)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/'.s:conceal
|
||||
execute 'syn match VimwikiTaskUuid containedin=VimwikiCheckBoxDone,VimwikiCheckBoxActive,VimwikiCheckBoxDeleted /\v#([A-Z]:)?[0-9a-fA-F]{8}$/'.s:conceal
|
||||
execute 'syn match VimwikiTaskUuid containedin=TaskWikiTask /\v#([A-Z]:)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/'.s:conceal
|
||||
execute 'syn match VimwikiTaskUuid containedin=TaskWikiTask /\v#([A-Z]:)?[0-9a-fA-F]{8}$/'.s:conceal
|
||||
|
||||
" Conceal header definitions
|
||||
for s:i in range(1,6)
|
||||
|
@ -12,8 +14,9 @@ endfor
|
|||
|
||||
" Define active and deleted task regions
|
||||
" Will be colored dynamically by Meta().source_tw_colors()
|
||||
syntax match VimwikiCheckBoxActive /\s*\*\s*\[S\]\s.*$/
|
||||
syntax match VimwikiCheckBoxDeleted /\s*\*\s*\[D\]\s.*$/
|
||||
syntax match TaskWikiTaskActive containedin=TaskWikiTask /\s*\*\s\[S\]\s.*$/
|
||||
syntax match TaskWikiTaskCompleted containedin=TaskWikiTask /\s*\*\s\[X\]\s.*$/
|
||||
syntax match TaskWikiTaskDeleted containedin=TaskWikiTask /\s*\*\s*\[D\]\s.*$/
|
||||
|
||||
" Set concealed parts as really concealed in normal mode, and with cursor over
|
||||
setlocal conceallevel=3
|
||||
|
|
|
@ -261,15 +261,15 @@ class Meta(object):
|
|||
|
||||
def source_tw_colors(self):
|
||||
colors = {
|
||||
'VimwikiCheckBoxActive': 'color.active',
|
||||
'VimwikiCheckBoxDone': 'color.completed',
|
||||
'VimwikiCheckBoxDeleted': 'color.active',
|
||||
'TaskWikiTaskActive': 'color.active',
|
||||
'TaskWikiTaskCompleted': 'color.completed',
|
||||
'TaskWikiTaskDeleted': 'color.deleted',
|
||||
}
|
||||
|
||||
links = {
|
||||
'VimwikiCheckBoxActive': 'Type',
|
||||
'VimwikiCheckBoxDone': 'Comment',
|
||||
'VimwikiCheckBoxDeleted': 'Error',
|
||||
'TaskWikiTaskActive': 'Type',
|
||||
'TaskWikiTaskCompleted': 'Comment',
|
||||
'TaskWikiTaskDeleted': 'Error',
|
||||
}
|
||||
|
||||
tw = cache.get_relevant_tw()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue