diff --git a/sources_non_forked/ale/ale_linters/clojure/clj_kondo.vim b/sources_non_forked/ale/ale_linters/clojure/clj_kondo.vim index e3f93b6b..a023f8b6 100644 --- a/sources_non_forked/ale/ale_linters/clojure/clj_kondo.vim +++ b/sources_non_forked/ale/ale_linters/clojure/clj_kondo.vim @@ -16,7 +16,7 @@ endfunction function! ale_linters#clojure#clj_kondo#HandleCljKondoFormat(buffer, lines) abort " output format " ::: : - let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):(\d+):? ((Exception|error|warning): ?(.+))$' + let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+)?:(\d+)?:? ((Exception|error|warning): ?(.+))$' let l:output = [] for l:match in ale#util#GetMatches(a:lines, l:pattern) diff --git a/sources_non_forked/ale/ale_linters/dockerfile/hadolint.vim b/sources_non_forked/ale/ale_linters/dockerfile/hadolint.vim index 45b03aed..278e9466 100644 --- a/sources_non_forked/ale/ale_linters/dockerfile/hadolint.vim +++ b/sources_non_forked/ale/ale_linters/dockerfile/hadolint.vim @@ -55,13 +55,19 @@ function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort let l:detail = 'hadolint could not parse the file because of a syntax error.' endif - call add(l:output, { + let l:line_output = { \ 'lnum': l:lnum, \ 'col': l:colnum, \ 'type': l:type, \ 'text': l:text, \ 'detail': l:detail - \}) + \} + + if l:code isnot# '' + let l:line_output['code'] = l:code + endif + + call add(l:output, l:line_output) endfor return l:output diff --git a/sources_non_forked/ale/ale_linters/ruby/ruby.vim b/sources_non_forked/ale/ale_linters/ruby/ruby.vim index 2dc55eb0..621fcbc0 100644 --- a/sources_non_forked/ale/ale_linters/ruby/ruby.vim +++ b/sources_non_forked/ale/ale_linters/ruby/ruby.vim @@ -6,7 +6,7 @@ call ale#Set('ruby_ruby_executable', 'ruby') call ale#linter#Define('ruby', { \ 'name': 'ruby', \ 'executable': {b -> ale#Var(b, 'ruby_ruby_executable')}, -\ 'command': '%e -w -c -T1 %t', +\ 'command': '%e -w -c %t', \ 'output_stream': 'stderr', \ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors', \}) diff --git a/sources_non_forked/ale/ale_linters/zeek/zeek.vim b/sources_non_forked/ale/ale_linters/zeek/zeek.vim new file mode 100644 index 00000000..e976d75c --- /dev/null +++ b/sources_non_forked/ale/ale_linters/zeek/zeek.vim @@ -0,0 +1,22 @@ +" Author: Benjamin Bannier +" Description: Support for checking Zeek files. +" +call ale#Set('zeek_zeek_executable', 'zeek') + +function! ale_linters#zeek#zeek#HandleErrors(buffer, lines) abort + let l:pattern = 'error in \v.*, line (\d+): (.*)$' + + return map(ale#util#GetMatches(a:lines, l:pattern), "{ + \ 'lnum': str2nr(v:val[1]), + \ 'text': v:val[2], + \}") +endfunction + +call ale#linter#Define('zeek', { +\ 'name': 'zeek', +\ 'executable': {b -> ale#Var(b, 'zeek_zeek_executable')}, +\ 'output_stream': 'stderr', +\ 'command': {-> '%e --parse-only %s'}, +\ 'callback': 'ale_linters#zeek#zeek#HandleErrors', +\ 'lint_file': 1, +\}) diff --git a/sources_non_forked/ale/autoload/ale/fix/registry.vim b/sources_non_forked/ale/autoload/ale/fix/registry.vim index 0447bd3e..c6764daf 100644 --- a/sources_non_forked/ale/autoload/ale/fix/registry.vim +++ b/sources_non_forked/ale/autoload/ale/fix/registry.vim @@ -100,6 +100,11 @@ let s:default_registry = { \ 'suggested_filetypes': ['nim'], \ 'description': 'Apply nimpretty to a file.', \ }, +\ 'erblint': { +\ 'function': 'ale#fixers#erblint#Fix', +\ 'suggested_filetypes': ['eruby'], +\ 'description': 'Apply erblint --autocorrect to a file.', +\ }, \ 'eslint': { \ 'function': 'ale#fixers#eslint#Fix', \ 'suggested_filetypes': ['javascript', 'typescript'], diff --git a/sources_non_forked/ale/autoload/ale/fixers/erblint.vim b/sources_non_forked/ale/autoload/ale/fixers/erblint.vim new file mode 100644 index 00000000..41aca0c8 --- /dev/null +++ b/sources_non_forked/ale/autoload/ale/fixers/erblint.vim @@ -0,0 +1,40 @@ +" Author: Roeland Moors - https://github.com/roelandmoors +" Description: ERB Lint, support for https://github.com/Shopify/erb-lint + +call ale#Set('eruby_erblint_executable', 'erblint') +call ale#Set('eruby_erblint_options', '') + + +" Erblint fixer outputs diagnostics first and then the fixed +" output. These are delimited by something like this: +" ================ /path/to/demo.html.erb ================== +" We only need the output after this +function! ale#fixers#erblint#PostProcess(buffer, output) abort + let l:line = 0 + + for l:output in a:output + let l:line = l:line + 1 + + if l:output =~# "^=\\+.*=\\+$" + break + endif + endfor + + return a:output[l:line :] +endfunction + +function! ale#fixers#erblint#GetCommand(buffer) abort + let l:executable = ale#Var(a:buffer, 'eruby_erblint_executable') + let l:options = ale#Var(a:buffer, 'eruby_erblint_options') + + return ale#ruby#EscapeExecutable(l:executable, 'erblint') + \ . (!empty(l:options) ? ' ' . l:options : '') + \ . ' --autocorrect --stdin %s' +endfunction + +function! ale#fixers#erblint#Fix(buffer) abort + return { + \ 'command': ale#fixers#erblint#GetCommand(a:buffer), + \ 'process_with': 'ale#fixers#erblint#PostProcess' + \} +endfunction diff --git a/sources_non_forked/ale/autoload/ale/fixers/isort.vim b/sources_non_forked/ale/autoload/ale/fixers/isort.vim index 082e77ec..6eb6a67c 100644 --- a/sources_non_forked/ale/autoload/ale/fixers/isort.vim +++ b/sources_non_forked/ale/autoload/ale/fixers/isort.vim @@ -21,7 +21,7 @@ function! ale#fixers#isort#GetExecutable(buffer) abort return ale#python#FindExecutable(a:buffer, 'python_isort', ['isort']) endfunction -function! ale#fixers#isort#Fix(buffer) abort +function! ale#fixers#isort#GetCmd(buffer) abort let l:executable = ale#fixers#isort#GetExecutable(a:buffer) let l:cmd = [ale#Escape(l:executable)] @@ -29,7 +29,20 @@ function! ale#fixers#isort#Fix(buffer) abort call extend(l:cmd, ['run', 'isort']) endif - call add(l:cmd, '--filename %s') + return join(l:cmd, ' ') +endfunction + +function! ale#fixers#isort#FixForVersion(buffer, version) abort + let l:executable = ale#fixers#isort#GetExecutable(a:buffer) + let l:cmd = [ale#Escape(l:executable)] + + if l:executable =~? 'pipenv\|poetry$' + call extend(l:cmd, ['run', 'isort']) + endif + + if ale#semver#GTE(a:version, [5, 7, 0]) + call add(l:cmd, '--filename %s') + endif let l:options = ale#Var(a:buffer, 'python_isort_options') @@ -41,6 +54,18 @@ function! ale#fixers#isort#Fix(buffer) abort return { \ 'cwd': '%s:h', - \ 'command': join(l:cmd, ' ') + \ 'command': join(l:cmd, ' '), \} endfunction + +function! ale#fixers#isort#Fix(buffer) abort + let l:executable = ale#fixers#isort#GetExecutable(a:buffer) + let l:command = ale#fixers#isort#GetCmd(a:buffer) . ale#Pad('--version') + + return ale#semver#RunWithVersionCheck( + \ a:buffer, + \ l:executable, + \ l:command, + \ function('ale#fixers#isort#FixForVersion'), + \) +endfunction diff --git a/sources_non_forked/ale/autoload/ale/lsp.vim b/sources_non_forked/ale/autoload/ale/lsp.vim index 510f3e95..75d81525 100644 --- a/sources_non_forked/ale/autoload/ale/lsp.vim +++ b/sources_non_forked/ale/autoload/ale/lsp.vim @@ -45,6 +45,7 @@ function! ale#lsp#Register(executable_or_address, project, init_options) abort \ 'typeDefinition': 0, \ 'symbol_search': 0, \ 'code_actions': 0, + \ 'did_save': 0, \ 'includeText': 0, \ }, \} @@ -265,15 +266,19 @@ function! s:UpdateCapabilities(conn, capabilities) abort let a:conn.capabilities.symbol_search = 1 endif - if has_key(a:capabilities, 'textDocumentSync') - if type(a:capabilities.textDocumentSync) is v:t_dict - let l:save = get(a:capabilities.textDocumentSync, 'save', v:false) + if type(get(a:capabilities, 'textDocumentSync')) is v:t_dict + let l:syncOptions = get(a:capabilities, 'textDocumentSync') - if type(l:save) is v:true - let a:conn.capabilities.includeText = 1 - endif + if get(l:syncOptions, 'save') is v:true + let a:conn.capabilities.did_save = 1 + endif - if type(l:save) is v:t_dict && get(a:capabilities.textDocumentSync.save, 'includeText', v:false) is v:true + if type(get(l:syncOptions, 'save')) is v:t_dict + let a:conn.capabilities.did_save = 1 + + let l:saveOptions = get(l:syncOptions, 'save') + + if get(l:saveOptions, 'includeText') is v:true let a:conn.capabilities.includeText = 1 endif endif diff --git a/sources_non_forked/ale/autoload/ale/lsp_linter.vim b/sources_non_forked/ale/autoload/ale/lsp_linter.vim index 753fb57b..230b3141 100644 --- a/sources_non_forked/ale/autoload/ale/lsp_linter.vim +++ b/sources_non_forked/ale/autoload/ale/lsp_linter.vim @@ -466,6 +466,7 @@ function! s:CheckWithLSP(linter, details) abort " If this was a file save event, also notify the server of that. if a:linter.lsp isnot# 'tsserver' \&& getbufvar(l:buffer, 'ale_save_event_fired', 0) + \&& ale#lsp#HasCapability(l:buffer, 'did_save') let l:include_text = ale#lsp#HasCapability(l:buffer, 'includeText') let l:save_message = ale#lsp#message#DidSave(l:buffer, l:include_text) let l:notified = ale#lsp#Send(l:id, l:save_message) != 0 diff --git a/sources_non_forked/ale/autoload/ale/virtualtext.vim b/sources_non_forked/ale/autoload/ale/virtualtext.vim index 2a9903bc..598bc1bf 100644 --- a/sources_non_forked/ale/autoload/ale/virtualtext.vim +++ b/sources_non_forked/ale/autoload/ale/virtualtext.vim @@ -64,15 +64,16 @@ function! ale#virtualtext#ShowMessage(message, hl_group) abort let l:line = line('.') let l:buffer = bufnr('') let l:prefix = get(g:, 'ale_virtualtext_prefix', '> ') + let l:msg = l:prefix.trim(substitute(a:message, '\n', ' ', 'g')) if has('nvim') - call nvim_buf_set_virtual_text(l:buffer, s:ns_id, l:line-1, [[l:prefix.a:message, a:hl_group]], {}) + call nvim_buf_set_virtual_text(l:buffer, s:ns_id, l:line-1, [[l:msg, a:hl_group]], {}) else let l:left_pad = col('$') call prop_add(l:line, l:left_pad, { \ 'type': 'ale', \}) - let s:last_popup = popup_create(l:prefix.a:message, { + let s:last_popup = popup_create(l:msg, { \ 'line': -1, \ 'padding': [0, 0, 0, 1], \ 'mask': [[1, 1, 1, 1]], diff --git a/sources_non_forked/ale/doc/ale-supported-languages-and-tools.txt b/sources_non_forked/ale/doc/ale-supported-languages-and-tools.txt index f98f9101..36ef83ea 100644 --- a/sources_non_forked/ale/doc/ale-supported-languages-and-tools.txt +++ b/sources_non_forked/ale/doc/ale-supported-languages-and-tools.txt @@ -601,6 +601,8 @@ Notes: * `yamllint` * YANG * `yang-lsp` +* Zeek + * `zeek`!! * Zig * `zls` diff --git a/sources_non_forked/ale/doc/ale-zeek.txt b/sources_non_forked/ale/doc/ale-zeek.txt new file mode 100644 index 00000000..910bc060 --- /dev/null +++ b/sources_non_forked/ale/doc/ale-zeek.txt @@ -0,0 +1,23 @@ +=============================================================================== +ALE Zeek Integration *ale-zeek-options* + *ale-integration-zeek* + +=============================================================================== +Integration Information + + Currently, the only supported linter for Zeek is zeek. + +=============================================================================== +zeek *ale-zeek-zeek* + +g:ale_zeek_zeek_executable *g:ale_zeek_zeek_executable* + *b:ale_zeek_zeek_executable* + Type: |String| + Default: `'zeek'` + + This variable can be modified to change the executable path for `zeek`. + + +=============================================================================== + vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: + diff --git a/sources_non_forked/ale/doc/ale.txt b/sources_non_forked/ale/doc/ale.txt index 97242748..6cc81784 100644 --- a/sources_non_forked/ale/doc/ale.txt +++ b/sources_non_forked/ale/doc/ale.txt @@ -3114,6 +3114,8 @@ documented in additional help files. yamllint..............................|ale-yaml-yamllint| yang....................................|ale-yang-options| yang-lsp..............................|ale-yang-lsp| + zeek....................................|ale-zeek-options| + zeek..................................|ale-zeek-zeek| zig.....................................|ale-zig-options| zls...................................|ale-zig-zls| diff --git a/sources_non_forked/ale/supported-tools.md b/sources_non_forked/ale/supported-tools.md index f643be5f..b2c0ec48 100644 --- a/sources_non_forked/ale/supported-tools.md +++ b/sources_non_forked/ale/supported-tools.md @@ -610,5 +610,7 @@ formatting. * [yamllint](https://yamllint.readthedocs.io/) * YANG * [yang-lsp](https://github.com/theia-ide/yang-lsp) +* Zeek + * [zeek](http://zeek.org) :floppy_disk: * Zig * [zls](https://github.com/zigtools/zls) diff --git a/sources_non_forked/ctrlp.vim/autoload/ctrlp.vim b/sources_non_forked/ctrlp.vim/autoload/ctrlp.vim index c8f5e1bc..38b6ed8b 100644 --- a/sources_non_forked/ctrlp.vim/autoload/ctrlp.vim +++ b/sources_non_forked/ctrlp.vim/autoload/ctrlp.vim @@ -1386,6 +1386,7 @@ fu! s:MarkToOpen() en en sil! cal ctrlp#statusline() + redr endf fu! s:OpenMulti(...) diff --git a/sources_non_forked/ctrlp.vim/readme.md b/sources_non_forked/ctrlp.vim/readme.md index 6ab8b246..9c9ef0ec 100644 --- a/sources_non_forked/ctrlp.vim/readme.md +++ b/sources_non_forked/ctrlp.vim/readme.md @@ -11,6 +11,17 @@ Full path fuzzy __file__, __buffer__, __mru__, __tag__, __...__ finder for Vim. ![ctrlp][1] +## Install + +vim 8+ manages packages all on its own. Installing `ctrlp` is this simple: + +```bash +mkdir -p ~/.vim/pack/plugins/start +git clone --depth=1 https://github.com/ctrlpvim/ctrlp.vim.git ~/.vim/pack/plugins/start/ctrlp +``` + +Of course you can use your favorite plugin manager or check the [quick installation guide][3] for a primitive installation method. + ## Basic Usage * Run `:CtrlP` or `:CtrlP [starting-directory]` to invoke CtrlP in find file mode. * Run `:CtrlPBuffer` or `:CtrlPMRU` to invoke CtrlP in find buffer or find MRU file mode. @@ -97,13 +108,10 @@ Use `:diffthis` when opening multiple files to run `:diffthis` on the first 4 fi Check `:help ctrlp-options` for other options. -## Installation -Use your favorite method or check the homepage for a [quick installation guide][3]. - ## License CtrlP is distributed under Vim's [license][4]. -[1]: http://i.imgur.com/aOcwHwt.png +[1]: https://i.imgur.com/aOcwHwt.png [2]: https://github.com/ctrlpvim/ctrlp.vim/tree/extensions -[3]: http://ctrlpvim.github.io/ctrlp.vim#installation +[3]: https://ctrlpvim.github.io/ctrlp.vim#installation [4]: http://vimdoc.sourceforge.net/htmldoc/uganda.html diff --git a/sources_non_forked/dracula/colors/dracula.vim b/sources_non_forked/dracula/colors/dracula.vim index 8c941101..224d5a65 100644 --- a/sources_non_forked/dracula/colors/dracula.vim +++ b/sources_non_forked/dracula/colors/dracula.vim @@ -85,6 +85,10 @@ if !exists('g:dracula_undercurl') let g:dracula_undercurl = g:dracula_underline endif +if !exists('g:dracula_full_special_attrs_support') + let g:dracula_full_special_attrs_support = has('gui_running') +endif + if !exists('g:dracula_inverse') let g:dracula_inverse = 1 endif @@ -111,10 +115,15 @@ function! s:h(scope, fg, ...) " bg, attr_list, special let l:attr_list = filter(get(a:, 2, ['NONE']), 'type(v:val) == 1') let l:attrs = len(l:attr_list) > 0 ? join(l:attr_list, ',') : 'NONE' - " Falls back to coloring foreground group on terminals because - " nearly all do not support undercurl + " If the UI does not have full support for special attributes (like underline and + " undercurl) and the highlight does not explicitly set the foreground color, + " make the foreground the same as the attribute color to ensure the user will + " get some highlight if the attribute is not supported. The default behavior + " is to assume that terminals do not have full support, but the user can set + " the global variable `g:dracula_full_special_attrs_support` explicitly if the + " default behavior is not desirable. let l:special = get(a:, 3, ['NONE', 'NONE']) - if l:special[0] !=# 'NONE' && l:fg[0] ==# 'NONE' && !has('gui_running') + if l:special[0] !=# 'NONE' && l:fg[0] ==# 'NONE' && !g:dracula_full_special_attrs_support let l:fg[0] = l:special[0] let l:fg[1] = l:special[1] endif diff --git a/sources_non_forked/dracula/doc/dracula.txt b/sources_non_forked/dracula/doc/dracula.txt index b60abb45..9becf935 100644 --- a/sources_non_forked/dracula/doc/dracula.txt +++ b/sources_non_forked/dracula/doc/dracula.txt @@ -1,4 +1,4 @@ -*dracula.txt* For Vim version 8 Last change: 2018 May 08 +*dracula.txt* For Vim version 8 Last change: 2021 Oct 22 *dracula* *vim-dracula* |\ ,, ~ @@ -86,6 +86,13 @@ Include underline attributes in highlighting > Include undercurl attributes in highlighting (only if underline enabled) > let g:dracula_undercurl = 1 +* *g:dracula_full_special_attrs_support* +Explicitly declare full support for special attributes. By default it is 1 +for graphical applications and 0 for terminals and terminal emulators. On +terminal emulators, set to 1 to allow underline/undercurl highlights without +changing the foreground color. > + let g:dracula_full_special_attrs_support = 1 + * *g:dracula_inverse* Include inverse attributes in highlighting > let g:dracula_inverse = 1 diff --git a/sources_non_forked/vim-fugitive/autoload/fugitive.vim b/sources_non_forked/vim-fugitive/autoload/fugitive.vim index a7303daa..5366c489 100644 --- a/sources_non_forked/vim-fugitive/autoload/fugitive.vim +++ b/sources_non_forked/vim-fugitive/autoload/fugitive.vim @@ -228,7 +228,7 @@ function! s:Map(mode, lhs, rhs, ...) abort endwhile if !skip && (flags !~# '' || empty(mapcheck(head.tail, mode))) call add(maps, mode.'map ' . s:nowait . substitute(flags, '', '', '') . ' ' . head.tail . ' ' . a:rhs) - if a:0 > 1 + if a:0 > 1 && a:2 let b:undo_ftplugin = get(b:, 'undo_ftplugin', 'exe') . \ '|sil! exe "' . mode . 'unmap ' . head.tail . '"' endif @@ -1253,30 +1253,34 @@ endfunction function! s:UrlParse(url) abort let scp_authority = matchstr(a:url, '^[^:/]\+\ze:\%(//\)\@!') if len(scp_authority) && !(has('win32') && scp_authority =~# '^\a:[\/]') - return {'scheme': 'ssh', 'authority': scp_authority, + let url = {'scheme': 'ssh', 'authority': scp_authority, \ 'path': strpart(a:url, len(scp_authority) + 1)} + elseif empty(a:url) + let url = {'scheme': '', 'authority': '', 'path': ''} + else + let match = matchlist(a:url, '^\([[:alnum:].+-]\+\)://\([^/]*\)\(/.*\)\=\%(#\|$\)') + if empty(match) + let url = {'scheme': 'file', 'authority': '', 'path': a:url} + else + let url = {'scheme': match[1], 'authority': match[2]} + let url.path = empty(match[3]) ? '/' : match[3] + endif endif - let match = matchlist(a:url, '^\([[:alnum:].+-]\+\)://\([^/]*\)\(/.*\)\=\%(#\|$\)') - if empty(match) - return {'scheme': 'file', 'authority': '', 'path': a:url} + if (url.scheme ==# 'ssh' || url.scheme ==# 'git') && url.path[0:1] ==# '/~' + let url.path = strpart(url.path, 1) endif - let remote = {'scheme': match[1], 'authority': match[2]} - let remote.path = empty(match[3]) ? '/' : match[3] - if (remote.scheme ==# 'ssh' || remote.scheme ==# 'git') && remote.path[0:1] ==# '/~' - let remote.path = strpart(remote.path, 1) - endif - return remote + return url endfunction -function! s:ResolveRemote(url) abort +function! s:RemoteResolve(url, flags) abort let remote = s:UrlParse(a:url) - if remote.scheme =~# '^https\=$' + if remote.scheme =~# '^https\=$' && index(a:flags, ':nohttp') < 0 let headers = fugitive#RemoteHttpHeaders(remote.scheme . '://' . remote.authority . remote.path) let loc = matchstr(get(headers, 'location', ''), '^https\=://.\{-\}\ze/info/refs?') if len(loc) let remote = s:UrlParse(loc) else - let remote.http_headers = headers + let remote.headers = headers endif elseif remote.scheme ==# 'ssh' let remote.authority = fugitive#SshHostAlias(remote.authority) @@ -1284,23 +1288,66 @@ function! s:ResolveRemote(url) abort return remote endfunction -function! fugitive#ResolveRemote(url) abort - let remote = s:ResolveRemote(a:url) - if remote.scheme ==# 'file' || remote.scheme ==# '' - return remote.path - elseif remote.path =~# '^/' - return remote.scheme . '://' . remote.authority . remote.path - elseif remote.path =~# '^\~' - return remote.scheme . '://' . remote.authority . '/' . remote.path - elseif remote.scheme ==# 'ssh' && remote.authority !~# ':' - return remote.authority . ':' . remote.path +function! s:ConfigLengthSort(i1, i2) abort + return len(a:i2[0]) - len(a:i1[0]) +endfunction + +function! s:RemoteCallback(config, into, flags, cb) abort + if a:into.remote_name =~# '^\.\=$' + let a:into.remote_name = s:RemoteDefault(a:config) + endif + let url = a:into.remote_name + + if url ==# '.git' + let url = s:GitDir(a:config) + elseif url !~# ':\|^/\|^\a:[\/]\|^\.\.\=/' + let url = FugitiveConfigGet('remote.' . url . '.url', a:config) + endif + let instead_of = [] + for [k, vs] in items(fugitive#ConfigGetRegexp('^url\.\zs.\{-\}\ze\.insteadof$', a:config)) + for v in vs + call add(instead_of, [v, k]) + endfor + endfor + call sort(instead_of, 's:ConfigLengthSort') + for [orig, replacement] in instead_of + if strpart(url, 0, len(orig)) ==# orig + let url = replacement . strpart(url, len(orig)) + break + endif + endfor + if index(a:flags, ':noresolve') < 0 + call extend(a:into, s:RemoteResolve(url, a:flags)) else - return a:url + call extend(a:into, s:UrlParse(url)) + endif + let a:into.user = matchstr(a:into.authority, '.\{-\}\ze@', '', '') + let a:into.host = substitute(a:into.authority, '.\{-\}@', '', '') + let a:into.hostname = substitute(a:into.host, ':\d\+$', '', '') + let a:into.port = matchstr(a:into.host, ':\zs\d\+$', '', '') + if a:into.path =~# '^/' + let a:into.url = a:into.scheme . '://' . a:into.authority . a:into.path + elseif a:into.path =~# '^\~' + let a:into.url = a:into.scheme . '://' . a:into.authority . '/' . a:into.path + elseif a:into.scheme ==# 'ssh' && a:into.authority !~# ':' + let a:into.url = a:into.authority . ':' . a:into.path + else + let a:into.url = url + endif + if len(a:cb) + call call(a:cb[0], [a:into] + a:cb[1:-1]) endif endfunction -function! s:ConfigLengthSort(i1, i2) abort - return len(a:i2[0]) - len(a:i1[0]) +function! s:Remote(dir, remote, flags, cb) abort + let into = {'remote_name': a:remote, 'git_dir': s:GitDir(a:dir)} + let config = fugitive#Config(a:dir, function('s:RemoteCallback'), into, a:flags, a:cb) + if len(a:cb) + return config + else + call fugitive#Wait(config) + return into + endif endfunction function! s:RemoteParseArgs(args) abort @@ -1340,34 +1387,22 @@ function! s:RemoteParseArgs(args) abort return [dir_or_config, remote, flags, cb] endfunction +function! fugitive#Remote(...) abort + let [dir_or_config, remote, flags, cb] = s:RemoteParseArgs(a:000) + return s:Remote(dir_or_config, remote, flags, cb) +endfunction + +function! s:RemoteUrlCallback(remote, callback) abort + return call(a:callback[0], [a:remote.url] + a:callback[1:-1]) +endfunction + function! fugitive#RemoteUrl(...) abort - let [dir_or_config, url, flags, cb] = s:RemoteParseArgs(a:000) - let config = fugitive#Config(dir_or_config) - if url =~# '^\.\=$' - let url = s:RemoteDefault(config) + let [dir_or_config, remote, flags, cb] = s:RemoteParseArgs(a:000) + if len(cb) + let cb = [function('s:RemoteUrlCallback'), cb] endif - if url ==# '.git' - let url = s:GitDir(config) - elseif url !~# ':\|^/\|^\.\.\=/' - let url = FugitiveConfigGet('remote.' . url . '.url', config) - endif - let instead_of = [] - for [k, vs] in items(fugitive#ConfigGetRegexp('^url\.\zs.\{-\}\ze\.insteadof$', config)) - for v in vs - call add(instead_of, [v, k]) - endfor - endfor - call sort(instead_of, 's:ConfigLengthSort') - for [orig, replacement] in instead_of - if strpart(url, 0, len(orig)) ==# orig - let url = replacement . strpart(url, len(orig)) - break - endif - endfor - if index(flags, 1) < 0 && index(flags, get(v:, 'true', 1)) < 0 && index(flags, ':noresolve') < 0 - let url = fugitive#ResolveRemote(url) - endif - return url + let remote = s:Remote(dir_or_config, remote, flags, cb) + return get(remote, 'url', remote) endfunction " Section: Quickfix @@ -2288,9 +2323,8 @@ function! s:FilterEscape(items, ...) abort let items = copy(a:items) call map(items, 's:fnameescape(v:val)') if a:0 && type(a:1) == type('') - let match = fnameescape(a:1) let cmp = s:FileIgnoreCase(1) ? '==?' : '==#' - call filter(items, 'strpart(v:val, 0, strlen(match)) ' . cmp . ' match') + call filter(items, 'strpart(v:val, 0, strlen(a:1)) ' . cmp . ' a:1') endif return items endfunction @@ -2384,7 +2418,7 @@ function! fugitive#CompleteObject(base, ...) abort let heads += ["stash"] let heads += sort(s:LinesError(["stash","list","--pretty=format:%gd"], dir)[0]) endif - let results += s:FilterEscape(heads, base) + let results += s:FilterEscape(heads, fnameescape(base)) endif let results += a:0 == 1 || a:0 >= 3 ? fugitive#CompletePath(base, 0, '', dir, a:0 >= 4 ? a:4 : tree) : fugitive#CompletePath(base) return results @@ -2406,7 +2440,7 @@ function! fugitive#CompleteObject(base, ...) abort call map(entries,'s:sub(v:val,"^04.*\\zs$","/")') call map(entries,'parent.s:sub(v:val,".*\t","")') endif - return s:FilterEscape(entries, base) + return s:FilterEscape(entries, fnameescape(base)) endfunction function! s:CompleteSub(subcommand, A, L, P, ...) abort @@ -2548,16 +2582,15 @@ let s:rebase_abbrevs = { \ 'b': 'break', \ } -function! fugitive#BufReadStatus() abort +function! fugitive#BufReadStatus(...) abort let amatch = s:Slash(expand('%:p')) - let b:fugitive_type = 'index' - unlet! b:fugitive_reltime + unlet! b:fugitive_reltime b:fugitive_type try silent doautocmd BufReadPre let config = fugitive#Config() let cmd = [fnamemodify(amatch, ':h')] - setlocal noro ma nomodeline buftype=nowrite + setlocal noreadonly modifiable nomodeline buftype=nowrite if s:cpath(fnamemodify($GIT_INDEX_FILE !=# '' ? FugitiveVimPath($GIT_INDEX_FILE) : fugitive#Find('.git/index'), ':p')) !=# s:cpath(amatch) let cmd += [{'env': {'GIT_INDEX_FILE': FugitiveGitPath(amatch)}}] endif @@ -2757,7 +2790,7 @@ function! fugitive#BufReadStatus() abort endif let b:fugitive_diff = diff - if v:cmdbang + if get(a:, 1, v:cmdbang) unlet! b:fugitive_expanded endif let expanded = get(b:, 'fugitive_expanded', {'Staged': {}, 'Unstaged': {}}) @@ -2875,6 +2908,8 @@ function! fugitive#BufReadStatus() abort return s:DoAutocmd('User FugitiveIndex') catch /^fugitive:/ return 'echoerr ' . string(v:exception) + finally + let b:fugitive_type = 'index' endtry endfunction @@ -3014,7 +3049,7 @@ function! fugitive#BufReadCmd(...) abort if b:fugitive_display_format call s:ReplaceCmd([dir, 'cat-file', b:fugitive_type, rev]) else - call s:ReplaceCmd([dir, '-c', 'diff.noprefix=false', 'show', '--no-color', '-m', '--first-parent', '--pretty=format:tree%x20%T%nparent%x20%P%nauthor%x20%an%x20<%ae>%x20%ad%ncommitter%x20%cn%x20<%ce>%x20%cd%nencoding%x20%e%n%n%s%n%n%b', rev]) + call s:ReplaceCmd([dir, '-c', 'diff.noprefix=false', '-c', 'log.showRoot=false', 'show', '--no-color', '-m', '--first-parent', '--pretty=format:tree%x20%T%nparent%x20%P%nauthor%x20%an%x20<%ae>%x20%ad%ncommitter%x20%cn%x20<%ce>%x20%cd%nencoding%x20%e%n%n%s%n%n%b', rev]) keepjumps 1 keepjumps call search('^parent ') if getline('.') ==# 'parent ' @@ -3159,6 +3194,9 @@ function! s:TempReadPost(file) abort if dict.filetype ==# 'man' && has('nvim') let b:man_sect = matchstr(getline(1), '^\w\+(\zs\d\+\ze)') endif + if !get(g:, 'did_load_ftplugin') && dict.filetype ==# 'fugitiveblame' + call s:BlameMaps(0) + endif let &l:filetype = dict.filetype endif setlocal foldmarker=<<<<<<<<,>>>>>>>> @@ -4085,7 +4123,7 @@ function! s:DoAutocmdChanged(dir) abort finally unlet! g:fugitive_event g:fugitive_result " Force statusline reload with the buffer's Git dir - let &ro = &ro + let &l:ro = &l:ro endtry return '' endfunction @@ -4096,7 +4134,7 @@ function! s:ReloadStatusBuffer(...) abort endif let original_lnum = a:0 ? a:1 : line('.') let info = s:StageInfo(original_lnum) - call fugitive#BufReadStatus() + call fugitive#BufReadStatus(0) call setpos('.', [0, s:StageSeek(info, original_lnum), 1, 0]) return '' endfunction @@ -4536,8 +4574,8 @@ endfunction function! s:PreviousItem(count) abort for i in range(a:count) - if !search(s:item_pattern, 'Wbe') && getline('.') !~# s:item_pattern - call search('^commit ', 'Wbe') + if !search(s:item_pattern, 'Wb') && getline('.') !~# s:item_pattern + call search('^commit ', 'Wb') endif endfor call s:StageReveal() @@ -7059,6 +7097,33 @@ function! s:BlameRehighlight() abort endfor endfunction +function! s:BlameMaps(is_ftplugin) abort + let ft = a:is_ftplugin + call s:Map('n', '', ':help :Git_blame', '', ft) + call s:Map('n', 'g?', ':help :Git_blame', '', ft) + if empty(mapcheck('q', 'n')) + nnoremap q :echoerr "fugitive: q removed in favor of gq (or :q)" + endif + call s:Map('n', 'gq', ':exe BlameQuit()', '', ft) + call s:Map('n', '<2-LeftMouse>', ':exe BlameCommit("exe BlameLeave()edit")', '', ft) + call s:Map('n', '', ':exe BlameCommit("exe BlameLeave()edit")', '', ft) + call s:Map('n', '-', ':exe BlameJump("")', '', ft) + call s:Map('n', 's', ':exe BlameJump("")', '', ft) + call s:Map('n', 'u', ':exe BlameJump("")', '', ft) + call s:Map('n', 'P', ':exe BlameJump("^".v:count1)', '', ft) + call s:Map('n', '~', ':exe BlameJump("~".v:count1)', '', ft) + call s:Map('n', 'i', ':exe BlameCommit("exe BlameLeave()edit")', '', ft) + call s:Map('n', 'o', ':exe BlameCommit("split")', '', ft) + call s:Map('n', 'O', ':exe BlameCommit("tabedit")', '', ft) + call s:Map('n', 'p', ':exe BlameCommit("pedit")', '', ft) + call s:Map('n', '.', ": =substitute(BlameCommitFileLnum()[0],'^$','@','')", ft) + call s:Map('n', '(', "-", ft) + call s:Map('n', ')', "+", ft) + call s:Map('n', 'A', ":exe 'vertical resize '.(linechars('.\\{-\\}\\ze [0-9:/+-][0-9:/+ -]* \\d\\+)')+1+v:count)", '', ft) + call s:Map('n', 'C', ":exe 'vertical resize '.(linechars('^\\S\\+')+1+v:count)", '', ft) + call s:Map('n', 'D', ":exe 'vertical resize '.(linechars('.\\{-\\}\\ze\\d\\ze\\s\\+\\d\\+)')+1-v:count)", '', ft) +endfunction + function! fugitive#BlameFileType() abort setlocal nomodeline setlocal foldmethod=manual @@ -7073,29 +7138,7 @@ function! fugitive#BlameFileType() abort if &modifiable return '' endif - call s:Map('n', '', ':help :Git_blame', '') - call s:Map('n', 'g?', ':help :Git_blame', '') - if empty(mapcheck('q', 'n')) - nnoremap q :echoerr "fugitive: q removed in favor of gq (or :q)" - endif - call s:Map('n', 'gq', ':exe BlameQuit()', '') - call s:Map('n', '<2-LeftMouse>', ':exe BlameCommit("exe BlameLeave()edit")', '') - call s:Map('n', '', ':exe BlameCommit("exe BlameLeave()edit")', '') - call s:Map('n', '-', ':exe BlameJump("")', '') - call s:Map('n', 's', ':exe BlameJump("")', '') - call s:Map('n', 'u', ':exe BlameJump("")', '') - call s:Map('n', 'P', ':exe BlameJump("^".v:count1)', '') - call s:Map('n', '~', ':exe BlameJump("~".v:count1)', '') - call s:Map('n', 'i', ':exe BlameCommit("exe BlameLeave()edit")', '') - call s:Map('n', 'o', ':exe BlameCommit("split")', '') - call s:Map('n', 'O', ':exe BlameCommit("tabedit")', '') - call s:Map('n', 'p', ':exe BlameCommit("pedit")', '') - call s:Map('n', '.', ": =substitute(BlameCommitFileLnum()[0],'^$','@','')") - call s:Map('n', '(', "-") - call s:Map('n', ')', "+") - call s:Map('n', 'A', ":exe 'vertical resize '.(linechars('.\\{-\\}\\ze [0-9:/+-][0-9:/+ -]* \\d\\+)')+1+v:count)", '') - call s:Map('n', 'C', ":exe 'vertical resize '.(linechars('^\\S\\+')+1+v:count)", '') - call s:Map('n', 'D', ":exe 'vertical resize '.(linechars('.\\{-\\}\\ze\\d\\ze\\s\\+\\d\\+)')+1-v:count)", '') + call s:BlameMaps(1) endfunction augroup fugitive_blame diff --git a/sources_non_forked/vim-fugitive/doc/fugitive.txt b/sources_non_forked/vim-fugitive/doc/fugitive.txt index f089d749..7e296c40 100644 --- a/sources_non_forked/vim-fugitive/doc/fugitive.txt +++ b/sources_non_forked/vim-fugitive/doc/fugitive.txt @@ -318,6 +318,7 @@ dv Perform a |:Gvdiffsplit| on the file under the cursor. *fugitive_ds* *fugitive_dh* ds Perform a |:Ghdiffsplit| on the file under the cursor. dh + *fugitive_dq* dq Close all but one diff buffer, and |:diffoff|! the last one. diff --git a/sources_non_forked/vim-fugitive/plugin/fugitive.vim b/sources_non_forked/vim-fugitive/plugin/fugitive.vim index c28fd5cc..7e5fa648 100644 --- a/sources_non_forked/vim-fugitive/plugin/fugitive.vim +++ b/sources_non_forked/vim-fugitive/plugin/fugitive.vim @@ -628,7 +628,7 @@ augroup fugitive autocmd BufReadCmd index{,.lock} \ if FugitiveIsGitDir(expand(':p:h')) | \ let b:git_dir = s:Slash(expand(':p:h')) | - \ exe fugitive#BufReadStatus() | + \ exe fugitive#BufReadStatus(v:cmdbang) | \ elseif filereadable(expand('')) | \ silent doautocmd BufReadPre | \ keepalt read | diff --git a/sources_non_forked/vim-indent-guides/LICENSE b/sources_non_forked/vim-indent-guides/LICENSE new file mode 100644 index 00000000..54da359d --- /dev/null +++ b/sources_non_forked/vim-indent-guides/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Nathanael Kane + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/sources_non_forked/vim-indent-guides/README.markdown b/sources_non_forked/vim-indent-guides/README.markdown index 366d41c9..a248fb36 100644 --- a/sources_non_forked/vim-indent-guides/README.markdown +++ b/sources_non_forked/vim-indent-guides/README.markdown @@ -1,4 +1,4 @@ -# Indent Guides +# Indent Guides (unmaintained) Indent Guides is a plugin for visually displaying indent levels in Vim. diff --git a/sources_non_forked/vim-snippets/snippets/cpp.snippets b/sources_non_forked/vim-snippets/snippets/cpp.snippets index f39d743e..5d99f3d6 100644 --- a/sources_non_forked/vim-snippets/snippets/cpp.snippets +++ b/sources_non_forked/vim-snippets/snippets/cpp.snippets @@ -216,6 +216,7 @@ snippet try }catch(${1}) { } +# auto function snippet af auto function auto ${1:name}(${2}) -> ${3:void} { diff --git a/sources_non_forked/vim-snippets/snippets/css.snippets b/sources_non_forked/vim-snippets/snippets/css.snippets index 879cb3c7..8e728b31 100644 --- a/sources_non_forked/vim-snippets/snippets/css.snippets +++ b/sources_non_forked/vim-snippets/snippets/css.snippets @@ -974,6 +974,7 @@ snippet pi:e snippet pi:c place-items: center; snippet pi:st + place-items: stretch; snippet pos position: ${1};${0} snippet pos:a diff --git a/sources_non_forked/vim-snippets/snippets/html.snippets b/sources_non_forked/vim-snippets/snippets/html.snippets index bc4599e3..0ec6cd89 100644 --- a/sources_non_forked/vim-snippets/snippets/html.snippets +++ b/sources_non_forked/vim-snippets/snippets/html.snippets @@ -399,7 +399,7 @@ snippet h6#
${0}
snippet head - + ${1:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`} ${0} @@ -609,7 +609,9 @@ snippet meta:d snippet meta:compat snippet meta:refresh - + +snippet meta:utf5 + snippet meta:utf snippet meter diff --git a/sources_non_forked/vim-surround/plugin/surround.vim b/sources_non_forked/vim-surround/plugin/surround.vim index 303bd2b3..527dc3c9 100644 --- a/sources_non_forked/vim-surround/plugin/surround.vim +++ b/sources_non_forked/vim-surround/plugin/surround.vim @@ -1,6 +1,6 @@ " surround.vim - Surroundings " Author: Tim Pope -" Version: 2.1 +" Version: 2.2 " GetLatestVimScripts: 1697 1 :AutoInstall: surround.vim if exists("g:loaded_surround") || &cp || v:version < 700