Some checks failed
		
		
	
	Detach Plugins / check (FlyGrep.vim) (push) Has been cancelled
				
			Detach Plugins / check (GitHub.vim) (push) Has been cancelled
				
			Detach Plugins / check (JavaUnit.vim) (push) Has been cancelled
				
			Detach Plugins / check (SourceCounter.vim) (push) Has been cancelled
				
			Detach Plugins / check (cpicker.nvim) (push) Has been cancelled
				
			Detach Plugins / check (dein-ui.vim) (push) Has been cancelled
				
			Detach Plugins / check (git.vim) (push) Has been cancelled
				
			Detach Plugins / check (iedit.vim) (push) Has been cancelled
				
			Detach Plugins / check (scrollbar.vim) (push) Has been cancelled
				
			Detach Plugins / check (vim-chat) (push) Has been cancelled
				
			Detach Plugins / check (vim-cheat) (push) Has been cancelled
				
			Detach Plugins / check (vim-todo) (push) Has been cancelled
				
			Detach Plugins / check (xmake.vim) (push) Has been cancelled
				
			test / Linux (nvim, nightly) (push) Has been cancelled
				
			test / Linux (nvim, v0.3.8) (push) Has been cancelled
				
			test / Linux (nvim, v0.4.0) (push) Has been cancelled
				
			test / Linux (nvim, v0.4.2) (push) Has been cancelled
				
			test / Linux (nvim, v0.4.3) (push) Has been cancelled
				
			test / Linux (nvim, v0.4.4) (push) Has been cancelled
				
			test / Linux (nvim, v0.5.0) (push) Has been cancelled
				
			test / Linux (nvim, v0.5.1) (push) Has been cancelled
				
			test / Linux (nvim, v0.6.0) (push) Has been cancelled
				
			test / Linux (nvim, v0.6.1) (push) Has been cancelled
				
			test / Linux (nvim, v0.7.0) (push) Has been cancelled
				
			test / Linux (nvim, v0.7.2) (push) Has been cancelled
				
			test / Linux (nvim, v0.8.0) (push) Has been cancelled
				
			test / Linux (nvim, v0.8.1) (push) Has been cancelled
				
			test / Linux (nvim, v0.8.2) (push) Has been cancelled
				
			test / Linux (nvim, v0.8.3) (push) Has been cancelled
				
			test / Linux (nvim, v0.9.0) (push) Has been cancelled
				
			test / Linux (nvim, v0.9.1) (push) Has been cancelled
				
			test / Linux (true, vim, v7.4.052) (push) Has been cancelled
				
			test / Linux (true, vim, v7.4.1689) (push) Has been cancelled
				
			test / Linux (true, vim, v7.4.629) (push) Has been cancelled
				
			test / Linux (true, vim, v8.0.0027) (push) Has been cancelled
				
			test / Linux (true, vim, v8.0.0183) (push) Has been cancelled
				
			test / Linux (vim, nightly) (push) Has been cancelled
				
			test / Linux (vim, v8.0.0184) (push) Has been cancelled
				
			test / Linux (vim, v8.0.1453) (push) Has been cancelled
				
			test / Linux (vim, v8.1.2269) (push) Has been cancelled
				
			test / Linux (vim, v8.2.2434) (push) Has been cancelled
				
			test / Linux (vim, v8.2.3995) (push) Has been cancelled
				
			test / Windows (nvim, nightly) (push) Has been cancelled
				
			test / Windows (nvim, v0.3.8) (push) Has been cancelled
				
			test / Windows (nvim, v0.4.2) (push) Has been cancelled
				
			test / Windows (nvim, v0.4.3) (push) Has been cancelled
				
			test / Windows (nvim, v0.4.4) (push) Has been cancelled
				
			test / Windows (nvim, v0.5.0) (push) Has been cancelled
				
			test / Windows (nvim, v0.5.1) (push) Has been cancelled
				
			test / Windows (nvim, v0.6.0) (push) Has been cancelled
				
			test / Windows (nvim, v0.6.1) (push) Has been cancelled
				
			test / Windows (nvim, v0.7.0) (push) Has been cancelled
				
			test / Windows (nvim, v0.7.2) (push) Has been cancelled
				
			test / Windows (nvim, v0.8.0) (push) Has been cancelled
				
			test / Windows (nvim, v0.8.1) (push) Has been cancelled
				
			test / Windows (nvim, v0.8.2) (push) Has been cancelled
				
			test / Windows (nvim, v0.8.3) (push) Has been cancelled
				
			test / Windows (nvim, v0.9.0) (push) Has been cancelled
				
			test / Windows (nvim, v0.9.1) (push) Has been cancelled
				
			test / Windows (vim, nightly) (push) Has been cancelled
				
			test / Windows (vim, v7.4.1185) (push) Has been cancelled
				
			test / Windows (vim, v7.4.1689) (push) Has been cancelled
				
			test / Windows (vim, v8.0.0027) (push) Has been cancelled
				
			test / Windows (vim, v8.0.1453) (push) Has been cancelled
				
			test / Windows (vim, v8.1.2269) (push) Has been cancelled
				
			test / Windows (vim, v8.2.2434) (push) Has been cancelled
				
			test / Windows (vim, v8.2.3995) (push) Has been cancelled
				
			docker / docker (push) Has been cancelled
				
			mirror / check (coding) (push) Has been cancelled
				
			mirror / check (gitee) (push) Has been cancelled
				
			mirror / check (gitlab) (push) Has been cancelled
				
			
		
			
				
	
	
		
			127 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			VimL
		
	
	
	
	
	
			
		
		
	
	
			127 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			VimL
		
	
	
	
	
	
" ___vital___
 | 
						|
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
 | 
						|
" Do not mofidify the code nor insert new lines before '" ___vital___'
 | 
						|
if v:version > 703 || v:version == 703 && has('patch1170')
 | 
						|
  function! vital#_easymotion#HitAHint#Hint#import() abort
 | 
						|
    return map({'create': '', '_vital_loaded': ''},  'function("s:" . v:key)')
 | 
						|
  endfunction
 | 
						|
else
 | 
						|
  function! s:_SID() abort
 | 
						|
    return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
 | 
						|
  endfunction
 | 
						|
  execute join(['function! vital#_easymotion#HitAHint#Hint#import() abort', printf("return map({'create': '', '_vital_loaded': ''}, \"function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
 | 
						|
  delfunction s:_SID
 | 
						|
endif
 | 
						|
" ___vital___
 | 
						|
" function() wrapper
 | 
						|
if v:version > 703 || v:version == 703 && has('patch1170')
 | 
						|
  let s:_function = function('function')
 | 
						|
else
 | 
						|
  function! s:_SID() abort
 | 
						|
    return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
 | 
						|
  endfunction
 | 
						|
  let s:_s = '<SNR>' . s:_SID() . '_'
 | 
						|
  function! s:_function(fstr) abort
 | 
						|
    return function(substitute(a:fstr, 's:', s:_s, 'g'))
 | 
						|
  endfunction
 | 
						|
endif
 | 
						|
 | 
						|
function! s:_assert(...) abort
 | 
						|
  return ''
 | 
						|
endfunction
 | 
						|
 | 
						|
function! s:_vital_loaded(V) abort
 | 
						|
  if a:V.exists('Vim.PowerAssert')
 | 
						|
    let s:assert = a:V.import('Vim.PowerAssert').assert
 | 
						|
  else
 | 
						|
    let s:assert = s:_function('s:_assert')
 | 
						|
  endif
 | 
						|
endfunction
 | 
						|
 | 
						|
" TERMS:
 | 
						|
"   key: A character to generate hint. e.g. a,b,c,d,e,f,...
 | 
						|
"   hint: A hint is a combination of keys. e.g. a,b,ab,abc,..
 | 
						|
 | 
						|
" s:create() assigns keys to each targets and generate hint dict.
 | 
						|
" Example:
 | 
						|
"   let targets = [1, 2, 3, 4, 5, 6]
 | 
						|
"   echo s:label(targets, ['a', 'b', 'c'])
 | 
						|
"   " => {
 | 
						|
"     'a': 1,
 | 
						|
"     'b': {
 | 
						|
"       'a': 2,
 | 
						|
"       'b': 3
 | 
						|
"     },
 | 
						|
"     'c': {
 | 
						|
"       'a': 4,
 | 
						|
"       'b': 5,
 | 
						|
"       'c': 6
 | 
						|
"     }
 | 
						|
"   }
 | 
						|
"   Hint-to-target:
 | 
						|
"     a  -> 1
 | 
						|
"     ba -> 2
 | 
						|
"     bb -> 3
 | 
						|
"     ca -> 4
 | 
						|
"     cb -> 5
 | 
						|
"     cc -> 6
 | 
						|
" @param {list<T>} targets
 | 
						|
" @param {list<string>} keys each key should be uniq
 | 
						|
" @return Tree{string: (T|Tree)}
 | 
						|
function! s:create(targets, keys) abort
 | 
						|
  exe s:assert('len(a:keys) > 1')
 | 
						|
  let groups = {}
 | 
						|
  let keys_count = reverse(s:_keys_count(len(a:targets), len(a:keys)))
 | 
						|
 | 
						|
  let target_idx = 0
 | 
						|
  let key_idx = 0
 | 
						|
  for key_count in keys_count
 | 
						|
    if key_count > 1
 | 
						|
      " We need to create a subgroup
 | 
						|
      " Recurse one level deeper
 | 
						|
      let sub_targets = a:targets[target_idx : target_idx + key_count - 1]
 | 
						|
      let groups[a:keys[key_idx]] = s:create(sub_targets, a:keys)
 | 
						|
    elseif key_count == 1
 | 
						|
      " Assign single target key_idx
 | 
						|
      let groups[a:keys[key_idx]] = a:targets[target_idx]
 | 
						|
    else
 | 
						|
      " No target
 | 
						|
      continue
 | 
						|
    endif
 | 
						|
    let key_idx += 1
 | 
						|
    let target_idx += key_count
 | 
						|
  endfor
 | 
						|
  return groups
 | 
						|
endfunction
 | 
						|
 | 
						|
" s:_keys_count() generates list which represents how many targets to be
 | 
						|
" assigned to the key.
 | 
						|
" If the count > 1, use tree recursively.
 | 
						|
" Example:
 | 
						|
"   echo s:_keys_count(5, 3)
 | 
						|
"   " => [3, 1, 1]
 | 
						|
"   echo s:_keys_count(8, 3)
 | 
						|
"   " => [3, 3, 2]
 | 
						|
" @param {number} target_len
 | 
						|
" @param {number} keys_len
 | 
						|
function! s:_keys_count(targets_len, keys_len) abort
 | 
						|
  exe s:assert('a:keys_len > 1')
 | 
						|
  let _keys_count = repeat([0], a:keys_len)
 | 
						|
  let is_first_level = 1
 | 
						|
  let targets_left_cnt = a:targets_len
 | 
						|
  while targets_left_cnt > 0
 | 
						|
    let cnt_to_add = is_first_level ? 1 : a:keys_len - 1
 | 
						|
    for i in range(a:keys_len)
 | 
						|
      let _keys_count[i] += cnt_to_add
 | 
						|
      let targets_left_cnt -= cnt_to_add
 | 
						|
      if targets_left_cnt <= 0
 | 
						|
        let _keys_count[i] += targets_left_cnt
 | 
						|
        break
 | 
						|
      endif
 | 
						|
    endfor
 | 
						|
    let is_first_level = 0
 | 
						|
  endwhile
 | 
						|
  exe s:assert('len(_keys_count) is# a:keys_len')
 | 
						|
  return _keys_count
 | 
						|
endfunction
 |