Showing 6 of 9 files from the diff.

@@ -10,6 +10,7 @@
Loading
10 10
let s:BUFFER = SpaceVim#api#import('vim#buffer')
11 11
let s:SYS = SpaceVim#api#import('system')
12 12
let s:LOG = SpaceVim#logger#derive('todo')
13 +
let s:REG = SpaceVim#api#import('vim#regex')
13 14
14 15
15 16
let [
@@ -65,10 +66,12 @@
Loading
65 66
66 67
  let s:todos = []
67 68
  let s:todo = {}
69 +
  let s:labels_regex = s:get_labels_regex()
70 +
  let s:labels_partten = s:get_labels_pattern()
68 71
  let argv = [s:grep_default_exe] + 
69 72
        \ s:grep_default_opt +
70 73
        \ s:grep_default_expr_opt
71 -
  let argv += [s:get_labels_regex()]
74 +
  let argv += [s:labels_regex]
72 75
  if s:SYS.isWindows && (s:grep_default_exe ==# 'rg' || s:grep_default_exe ==# 'ag' || s:grep_default_exe ==# 'pt' )
73 76
    let argv += ['.']
74 77
  elseif s:SYS.isWindows && s:grep_default_exe ==# 'findstr'
@@ -76,24 +79,27 @@
Loading
76 79
  endif
77 80
  let argv += s:grep_default_ropt
78 81
  call s:LOG.info('cmd: ' . string(argv))
79 -
  let jobid = s:JOB.start(argv, {
82 +
  call s:LOG.info('   labels_partten: ' . s:labels_partten)
83 +
  let s:todo_jobid = s:JOB.start(argv, {
80 84
        \ 'on_stdout' : function('s:stdout'),
81 85
        \ 'on_stderr' : function('s:stderr'),
82 86
        \ 'on_exit' : function('s:exit'),
83 87
        \ })
84 -
  call s:LOG.info('jobid: ' . string(jobid))
88 +
  call s:LOG.info('jobid: ' . string(s:todo_jobid))
85 89
endfunction
86 90
87 91
function! s:stdout(id, data, event) abort
92 +
  if a:id !=# s:todo_jobid
93 +
    return
94 +
  endif
88 95
  for data in a:data
89 96
    call s:LOG.info('stdout: ' . data)
90 97
    if !empty(data)
91 98
      let file = fnameescape(split(data, ':\d\+:')[0])
92 99
      let line = matchstr(data, ':\d\+:')[1:-2]
93 100
      let column = matchstr(data, '\(:\d\+\)\@<=:\d\+:')[1:-2]
94 -
      let full_label = matchstr(data, s:get_labels_pattern())
95 -
      let trimmed_label = substitute(full_label, '\W', '', 'g')
96 -
      let title = get(split(data, full_label), 1, '')
101 +
      let label = matchstr(data, s:labels_partten)
102 +
      let title = get(split(data, label), 1, '')
97 103
      " @todo add time tag
98 104
      call add(s:todos, 
99 105
            \ {
@@ -101,7 +107,7 @@
Loading
101 107
            \ 'line' : line,
102 108
            \ 'column' : column,
103 109
            \ 'title' : title,
104 -
            \ 'label' : trimmed_label,
110 +
            \ 'label' : label,
105 111
            \ }
106 112
            \ )
107 113
    endif
@@ -109,21 +115,28 @@
Loading
109 115
endfunction
110 116
111 117
function! s:stderr(id, data, event) abort
118 +
  if a:id !=# s:todo_jobid
119 +
    return
120 +
  endif
112 121
  for date in a:data
113 122
    call s:LOG.info('stderr: ' . string(a:data))
114 123
  endfor
115 124
endfunction
116 125
117 126
function! s:exit(id, data, event ) abort
118 -
  call s:LOG.info('exit code: ' . string(a:data))
127 +
  if a:id !=# s:todo_jobid
128 +
    return
129 +
  endif
130 +
  call s:LOG.info('todomanager exit: ' . string(a:data))
119 131
  let s:todos = sort(s:todos, function('s:compare_todo'))
120 132
  let label_w = max(map(deepcopy(s:todos), 'strlen(v:val.label)'))
121 133
  let file_w = max(map(deepcopy(s:todos), 'strlen(v:val.file)'))
122 -
  let expr = "tolower(v:val.label) . repeat(' ', label_w - strlen(v:val.label)) . ' ' ."
134 +
  let expr = "v:val.label . repeat(' ', label_w - strlen(v:val.label)) . ' ' ."
123 135
        \ .  "SpaceVim#api#import('file').unify_path(v:val.file, ':.') . repeat(' ', file_w - strlen(v:val.file)) . ' ' ."
124 -
        \ .  'v:val.title'
136 +
        \ .  "v:val.title"
125 137
  let lines = map(deepcopy(s:todos),expr)
126 138
  call s:BUFFER.buf_set_lines(s:bufnr, 0 , -1, 0, lines)
139 +
  let g:wsd = s:todos
127 140
endfunction
128 141
129 142
function! s:compare_todo(a, b) abort
@@ -159,13 +172,12 @@
Loading
159 172
    let separator = '|'
160 173
  endif
161 174
162 -
  return join(map(copy(s:labels),
163 -
  \ "(v:val[0] =~ '\w' ? '\\b' : '') . v:val . '\\b:?'"),
175 +
  return join(map(copy(s:labels), "v:val . '\\b'"),
164 176
  \ separator)
165 177
endfunc
166 178
167 -
function! s:get_labels_pattern ()
168 -
  return '\C' . join(map(copy(s:labels), "(v:val[0] =~ '\w' ? '\\<' : '') . v:val . '\\>:\\?'"), '\|')
179 +
function! s:get_labels_pattern()
180 +
  return s:REG.parser(s:get_labels_regex(), 0)
169 181
endfunc
170 182
171 183

@@ -44,7 +44,15 @@
Loading
44 44
45 45
  " word boundary
46 46
  " \bword\b => <word>
47 -
  let vim_regex = substitute(vim_regex, '\\b\(\w\+\)\\b', '\\<\1\\>', 'g')
47 +
  let vim_regex = substitute(vim_regex, '\\b\(\w\+\)\\b', '<\1>', 'g')
48 +
49 +
  " right word boundary
50 +
  " \bword => \<word
51 +
  let vim_regex = substitute(vim_regex, '\\b\(\w\+\)', '<\1', 'g')
52 +
53 +
  " left word boundary
54 +
  " word\b => word\>
55 +
  let vim_regex = substitute(vim_regex, '\(\w\+\)\\b', '\1>', 'g')
48 56
49 57
  " case-insensitive
50 58
  " (?i)abc => \cabc

@@ -913,7 +913,7 @@
Loading
913 913
" }}}
914 914
915 915
function! s:update_statusline() abort
916 -
  if !g:FlyGrep_enable_statusline
916 +
  if !get(g:, 'FlyGrep_enable_statusline', 1)
917 917
    return
918 918
  endif
919 919

@@ -1,25 +1,25 @@
Loading
1 -
if exists('b:current_syntax') && b:current_syntax ==# 'SpaceVimTasksInfo'
2 -
  finish
3 -
endif
4 -
let b:current_syntax = 'SpaceVimTasksInfo'
5 -
syntax case ignore
6 -
7 -
syn match TaskName /^\[.*\]/
8 -
syn match TaskTitle /^Task\s\+Type\s\+Command/
9 -
10 -
" @question Why \zs does not work in syntax file?
11 -
" ref:
12 -
" https://github.com/vim/vim/issues/598
13 -
" https://stackoverflow.com/questions/49323753/vim-syntax-file-not-matching-with-zs
14 -
" https://stackoverflow.com/questions/64153655/why-taskinfo-syntax-file-does-not-work-as-expect
15 -
" syn match TaskType  /^\[.*\]\s*\zs[a-z]*/
16 -
" syn match TaskDescription  /^\[.*\]\s*[a-z]*\s\+\zs.*/
17 -
18 -
syn match TaskType  /\(^\[.\+\]\s\+\)\@<=[a-z]*/
19 -
syn match TaskDescription  /\(^\[.*\]\s\+[a-z]\+\s\+\)\@<=.*/
20 -
hi def link TaskTitle Title
21 -
hi def link TaskName String
22 -
hi def link TaskType Todo
23 -
hi def link TaskDescription Comment
24 -
25 -
1 +
if exists('b:current_syntax') && b:current_syntax ==# 'SpaceVimTasksInfo'
2 +
  finish
3 +
endif
4 +
let b:current_syntax = 'SpaceVimTasksInfo'
5 +
syntax case ignore
6 +
7 +
syn match TaskName /^\[.*\]/
8 +
syn match TaskTitle /^Task\s\+Type\s\+Command/
9 +
10 +
" @question Why \zs does not work in syntax file?
11 +
" ref:
12 +
" https://github.com/vim/vim/issues/598
13 +
" https://stackoverflow.com/questions/49323753/vim-syntax-file-not-matching-with-zs
14 +
" https://stackoverflow.com/questions/64153655/why-taskinfo-syntax-file-does-not-work-as-expect
15 +
" syn match TaskType  /^\[.*\]\s*\zs[a-z]*/
16 +
" syn match TaskDescription  /^\[.*\]\s*[a-z]*\s\+\zs.*/
17 +
18 +
syn match TaskType  /\(^\[.\+\]\s\+\)\@<=[a-z]*/
19 +
syn match TaskDescription  /\(^\[.*\]\s\+[a-z]\+\s\+\)\@<=.*/
20 +
hi def link TaskTitle Title
21 +
hi def link TaskName String
22 +
hi def link TaskType Todo
23 +
hi def link TaskDescription Comment
24 +
25 +

@@ -91,7 +91,7 @@
Loading
91 91
92 92
function! s:self.win_close(id, focuce) abort
93 93
  return nvim_win_close(a:id, a:focuce)
94 -
  " @fixme: nvim_win_close only support one argv in old version
94 +
  " @fixme nvim_win_close only support one argv in old version
95 95
  try
96 96
    return nvim_win_close(a:id, a:focuce)
97 97
  catch /^Vim\%((\a\+)\)\=:E118/

@@ -4,12 +4,10 @@
Loading
4 4
let b:current_syntax = 'SpaceVimTodoManager'
5 5
syntax case ignore
6 6
7 -
syn match FileName /\(^\S\+\s\+\)\@<=[^ ]*/
7 +
syn match FileName /\(@[a-zA-Z]*\s\+\)\@<=[^ ]*/
8 8
syn match TODOTAG  /^\s*@[a-zA-Z]*/
9 -
syn match TODOTAG  /^\s*@\?todo*/
10 9
syn match TODOQUESTION  /^\s*@ques[a-z]*/
11 -
syn match TODOFIXME  /^\s*@\?fixm[a-z]*/
12 -
syn match TODOFIXME  /^\s*@\?xxx*/
10 +
syn match TODOFIXME  /^\s*@fixm[a-z]*/
13 11
" syn match TODOCHECKBOX /[\d\+/\d\+\]/
14 12
syn match TODOINDEX /^\s\+\d\+\.\s/
15 13
syn match TODOCHECKBOXPANDING /\s\+√\s\+/
@@ -20,4 +18,3 @@
Loading
20 18
hi def link TODOTAG Todo
21 19
hi def link TODOQUESTION Question
22 20
hi def link TODOFIXME ErrorMsg
23 -
Files Coverage
.SpaceVim.d/autoload/SpaceVim 0.00%
autoload 3.11%
bundle 2.54%
config 30.02%
ftplugin 23.33%
syntax 94.48%
.ci/common/github_commenter.vim 0.00%
after/syntax/help.vim 0.00%
colors/SpaceVim.vim 0.00%
filetype.vim 100.00%
ginit.vim 0.00%
init.vim 0.00%
test/vimrc 100.00%
vimrc 30.77%
Project Totals (1541 files) 3.17%
11576.19
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
11576.18
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
11574.15
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
11574.14
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
11574.17
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
11574.16
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
11574.19
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
11574.18
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
11576.15
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
11576.14
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
11576.17
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
11576.16
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
1
comment: off
2
codecov:
3
  branch: master
4
coverage:
5
  status:
6
    patch:
7
      default: false
8
    project:
9
      default: false  # disable the default status that measures entire project
10
      api:  # declare a new status context "api"
11
        target: 1%  # we always want 35% coverage here
12
        paths:
13
          - "autoload/SpaceVim/api/"  # only include coverage in "autoload/SpaceVim/api/" folder
14
      plugins:  # declare a new status context "api"
15
        target: 1%  # we always want 35% coverage here
16
        paths:
17
          - "autoload/SpaceVim/plugins/"  # only include coverage in "autoload/SpaceVim/api/" folder
18
      all:  # declare a new status context "all"
19
        target: 1%  # we always want 35% coverage here
20
        paths:
21
          - "!tests/"  # remove all files in "tests/"
22
          - "!bundle/"  # remove all files in "tests/"
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading