-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev': Bump up version to 1.1.0
- Loading branch information
Showing
16 changed files
with
1,344 additions
and
229 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
"============================================================================= | ||
" FILE: autoload/incsearch/config.vim | ||
" AUTHOR: haya14busa | ||
" License: MIT license | ||
"============================================================================= | ||
scriptencoding utf-8 | ||
let s:save_cpo = &cpo | ||
set cpo&vim | ||
|
||
let s:TRUE = !0 | ||
let s:FALSE = 0 | ||
lockvar s:TRUE s:FALSE | ||
|
||
"" incsearch config | ||
" TODO: more detail documentation | ||
" @command is equivalent with base_key TODO: fix this inconsistence | ||
" @count1 default: v:count1 secret | ||
" @mode default: mode(1) secret | ||
let s:config = { | ||
\ 'command': '/', | ||
\ 'is_stay': s:FALSE, | ||
\ 'is_expr': s:FALSE, | ||
\ 'pattern': '', | ||
\ 'mode': 'n', | ||
\ 'count1': 1, | ||
\ 'modules': [] | ||
\ } | ||
|
||
" @return config for lazy value | ||
function! s:lazy_config() abort | ||
let m = mode(1) | ||
return {'count1': v:count1, 'mode': m, 'is_expr': (m is# 'no')} | ||
endfunction | ||
|
||
" @return config with default value | ||
function! incsearch#config#make(additional) abort | ||
let default = extend(copy(s:config), s:lazy_config()) | ||
let c = extend(default, a:additional) | ||
return c | ||
endfunction | ||
|
||
let &cpo = s:save_cpo | ||
unlet s:save_cpo | ||
" __END__ | ||
" vim: expandtab softtabstop=2 shiftwidth=2 foldmethod=marker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
scriptencoding utf-8 | ||
let s:save_cpo = &cpo | ||
set cpo&vim | ||
|
||
|
||
function! s:_vital_loaded(V) | ||
let s:V = a:V | ||
let s:Buffer = a:V.import("Vim.Buffer") | ||
endfunction | ||
|
||
|
||
function! s:_vital_depends() | ||
return [ | ||
\ "Vim.Buffer", | ||
\ ] | ||
endfunction | ||
|
||
|
||
function! s:windo(func, args, ...) | ||
let dict = get(a:, 1, {}) | ||
if len(tabpagebuflist()) <= 1 || s:Buffer.is_cmdwin() | ||
return call(a:func, a:args, dict) | ||
endif | ||
let pre_winnr = winnr() | ||
|
||
noautocmd windo call call(a:func, a:args, dict) | ||
|
||
if pre_winnr == winnr() | ||
return | ||
endif | ||
execute pre_winnr . "wincmd w" | ||
endfunction | ||
|
||
|
||
function! s:as_windo(base) | ||
let windo = {} | ||
let windo.obj = a:base | ||
for [key, Value] in items(a:base) | ||
if type(function("tr")) == type(Value) | ||
execute | ||
\ "function! windo.". key. "(...)\n" | ||
\ " return s:windo(self.obj." . key . ", a:000, self.obj)\n" | ||
\ "endfunction" | ||
endif | ||
unlet Value | ||
endfor | ||
return windo | ||
endfunction | ||
|
||
|
||
|
||
let &cpo = s:save_cpo | ||
unlet s:save_cpo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.