From fd420a05211b09067e0af457c7f2ca48546f59e0 Mon Sep 17 00:00:00 2001 From: Amir Date: Wed, 23 Jun 2021 11:57:12 +0200 Subject: [PATCH] Updated plugins --- .../ale/ale_linters/java/javac.vim | 4 +- .../ale/ale_linters/yaml/circleci.vim | 35 ++++++++++++++++++ .../ale/autoload/ale/completion.vim | 20 ++++++---- .../ale/autoload/ale/debugging.vim | 8 +--- .../ale/autoload/ale/filetypes.vim | 4 +- .../ale/autoload/ale/handlers/eslint.vim | 16 +++++--- sources_non_forked/ale/autoload/ale/sign.vim | 12 +++--- .../doc/ale-supported-languages-and-tools.txt | 1 + sources_non_forked/ale/doc/ale-yaml.txt | 26 +++++++++++++ sources_non_forked/ale/doc/ale.txt | 17 ++++++++- sources_non_forked/ale/supported-tools.md | 1 + sources_non_forked/lightline-ale/README.md | 2 +- .../vim-fugitive/autoload/fugitive.vim | 31 ++++++++++------ .../vim-fugitive/ftplugin/fugitiveblame.vim | 2 +- .../vim-fugitive/syntax/fugitiveblame.vim | 2 +- sources_non_forked/vim-gitgutter/README.mkd | 7 +++- .../vim-gitgutter/autoload/gitgutter/hunk.vim | 37 ++++++++++++------- .../vim-gitgutter/doc/gitgutter.txt | 21 ++++++++--- .../vim-ruby/spec/syntax/symbols_spec.rb | 8 ++++ .../vim-ruby/spec/vim/plugin/syntax_test.vim | 2 +- sources_non_forked/vim-ruby/syntax/ruby.vim | 8 ++-- .../vim-snipmate/doc/snipMate.txt | 2 +- .../vim-snippets/UltiSnips/julia.snippets | 9 +++++ .../vim-snippets/snippets/python.snippets | 2 +- .../vim-snippets/snippets/rust.snippets | 2 +- .../vim-snippets/snippets/vue.snippets | 2 +- 26 files changed, 208 insertions(+), 73 deletions(-) create mode 100644 sources_non_forked/ale/ale_linters/yaml/circleci.vim diff --git a/sources_non_forked/ale/ale_linters/java/javac.vim b/sources_non_forked/ale/ale_linters/java/javac.vim index 760f234c..971e8de0 100644 --- a/sources_non_forked/ale/ale_linters/java/javac.vim +++ b/sources_non_forked/ale/ale_linters/java/javac.vim @@ -132,7 +132,9 @@ function! ale_linters#java#javac#Handle(buffer, lines) abort for l:match in ale#util#GetMatches(a:lines, [l:pattern, l:col_pattern, l:symbol_pattern]) if empty(l:match[2]) && empty(l:match[3]) - let l:output[-1].col = len(l:match[1]) + if !empty(l:match[1]) && !empty(l:output) + let l:output[-1].col = len(l:match[1]) + endif elseif empty(l:match[3]) " Add symbols to 'cannot find symbol' errors. if l:output[-1].text is# 'error: cannot find symbol' diff --git a/sources_non_forked/ale/ale_linters/yaml/circleci.vim b/sources_non_forked/ale/ale_linters/yaml/circleci.vim new file mode 100644 index 00000000..3df61459 --- /dev/null +++ b/sources_non_forked/ale/ale_linters/yaml/circleci.vim @@ -0,0 +1,35 @@ +function! ale_linters#yaml#circleci#Handle(buffer, lines) abort + let l:match_index = -1 + let l:output = [] + + for l:index in range(len(a:lines)) + let l:line = a:lines[l:index] + + if l:line =~? 'Error: ERROR IN CONFIG FILE:' + let l:match_index = l:index + 1 + break + endif + endfor + + if l:match_index > 0 + return [{ + \ 'type': 'E', + \ 'lnum': 1, + \ 'text': a:lines[l:match_index], + \ 'detail': join(a:lines[l:match_index :], "\n"), + \}] + endif + + return [] +endfunction + +" The circleci validate requires network requests, so we'll only run it when +" files are saved to prevent the server from being hammered. +call ale#linter#Define('yaml', { +\ 'name': 'circleci', +\ 'executable': {b -> expand('#' . b . ':p') =~? '\.circleci' ? 'circleci' : ''}, +\ 'command': 'circleci config validate - < %s', +\ 'callback': 'ale_linters#yaml#circleci#Handle', +\ 'output_stream': 'stderr', +\ 'lint_file': 1, +\}) diff --git a/sources_non_forked/ale/autoload/ale/completion.vim b/sources_non_forked/ale/autoload/ale/completion.vim index 332d0734..4cf3a51a 100644 --- a/sources_non_forked/ale/autoload/ale/completion.vim +++ b/sources_non_forked/ale/autoload/ale/completion.vim @@ -269,13 +269,19 @@ function! s:ReplaceCompletionOptions(source) abort let b:ale_old_completeopt = &l:completeopt endif - if &l:completeopt =~# 'preview' - let &l:completeopt = 'menu,menuone,preview,noselect,noinsert' - elseif &l:completeopt =~# 'popup' - let &l:completeopt = 'menu,menuone,popup,noselect,noinsert' - else - let &l:completeopt = 'menu,menuone,noselect,noinsert' - endif + let l:opt_list = split(&l:completeopt, ',') + " The menu and noinsert options must be set, or automatic completion + " will be annoying. + let l:new_opt_list = ['menu', 'menuone', 'noinsert'] + + " Permit some other completion options, provided users have set them. + for l:opt in ['preview', 'popup', 'noselect'] + if index(l:opt_list, l:opt) >= 0 + call add(l:new_opt_list, l:opt) + endif + endfor + + let &l:completeopt = join(l:new_opt_list, ',') endif endfunction diff --git a/sources_non_forked/ale/autoload/ale/debugging.vim b/sources_non_forked/ale/autoload/ale/debugging.vim index 1f7ea467..efd52776 100644 --- a/sources_non_forked/ale/autoload/ale/debugging.vim +++ b/sources_non_forked/ale/autoload/ale/debugging.vim @@ -259,9 +259,7 @@ function! ale#debugging#InfoToClipboard() abort return endif - redir => l:output - silent call ale#debugging#Info() - redir END + let l:output = execute('call ale#debugging#Info()') let @+ = l:output call s:Echo('ALEInfo copied to your clipboard') @@ -270,9 +268,7 @@ endfunction function! ale#debugging#InfoToFile(filename) abort let l:expanded_filename = expand(a:filename) - redir => l:output - silent call ale#debugging#Info() - redir END + let l:output = execute('call ale#debugging#Info()') call writefile(split(l:output, "\n"), l:expanded_filename) call s:Echo('ALEInfo written to ' . l:expanded_filename) diff --git a/sources_non_forked/ale/autoload/ale/filetypes.vim b/sources_non_forked/ale/autoload/ale/filetypes.vim index 6cdc9ece..340a9c4e 100644 --- a/sources_non_forked/ale/autoload/ale/filetypes.vim +++ b/sources_non_forked/ale/autoload/ale/filetypes.vim @@ -4,9 +4,7 @@ function! ale#filetypes#LoadExtensionMap() abort " Output includes: " '*.erl setf erlang' - redir => l:output - silent exec 'autocmd' - redir end + let l:output = execute('exec "autocmd"') let l:map = {} diff --git a/sources_non_forked/ale/autoload/ale/handlers/eslint.vim b/sources_non_forked/ale/autoload/ale/handlers/eslint.vim index 7c492968..374460bc 100644 --- a/sources_non_forked/ale/autoload/ale/handlers/eslint.vim +++ b/sources_non_forked/ale/autoload/ale/handlers/eslint.vim @@ -2,10 +2,10 @@ " Description: Functions for working with eslint, for checking or fixing files. let s:executables = [ +\ '.yarn/sdks/eslint/bin/eslint.js', \ 'node_modules/.bin/eslint_d', \ 'node_modules/eslint/bin/eslint.js', \ 'node_modules/.bin/eslint', -\ '.yarn/sdks/eslint/bin/eslint', \] let s:sep = has('win32') ? '\' : '/' @@ -52,14 +52,20 @@ function! ale#handlers#eslint#GetCwd(buffer) abort let l:executable = ale#path#FindNearestExecutable(a:buffer, s:executables) if !empty(l:executable) - let l:nmi = strridx(l:executable, 'node_modules') - let l:project_dir = l:executable[0:l:nmi - 2] + let l:modules_index = strridx(l:executable, 'node_modules') + let l:modules_root = l:modules_index > -1 ? l:executable[0:l:modules_index - 2] : '' + + let l:sdks_index = strridx(l:executable, ale#path#Simplify('.yarn/sdks')) + let l:sdks_root = l:sdks_index > -1 ? l:executable[0:l:sdks_index - 2] : '' else let l:modules_dir = ale#path#FindNearestDirectory(a:buffer, 'node_modules') - let l:project_dir = !empty(l:modules_dir) ? fnamemodify(l:modules_dir, ':h:h') : '' + let l:modules_root = !empty(l:modules_dir) ? fnamemodify(l:modules_dir, ':h:h') : '' + + let l:sdks_dir = ale#path#FindNearestDirectory(a:buffer, ale#path#Simplify('.yarn/sdks')) + let l:sdks_root = !empty(l:sdks_dir) ? fnamemodify(l:sdks_dir, ':h:h:h') : '' endif - return !empty(l:project_dir) ? l:project_dir : '' + return strlen(l:modules_root) > strlen(l:sdks_root) ? l:modules_root : l:sdks_root endfunction function! ale#handlers#eslint#GetCommand(buffer) abort diff --git a/sources_non_forked/ale/autoload/ale/sign.vim b/sources_non_forked/ale/autoload/ale/sign.vim index e796f0f0..0607e17a 100644 --- a/sources_non_forked/ale/autoload/ale/sign.vim +++ b/sources_non_forked/ale/autoload/ale/sign.vim @@ -52,9 +52,7 @@ endif function! ale#sign#SetUpDefaultColumnWithoutErrorsHighlight() abort let l:verbose = &verbose set verbose=0 - redir => l:output - 0verbose silent highlight SignColumn - redir end + let l:output = execute('highlight SignColumn', 'silent') let &verbose = l:verbose let l:highlight_syntax = join(split(l:output)[2:]) @@ -171,10 +169,10 @@ endfunction " Read sign data for a buffer to a list of lines. function! ale#sign#ReadSigns(buffer) abort - redir => l:output - silent execute 'sign place ' . s:GroupCmd() . s:PriorityCmd() - \ . ' buffer=' . a:buffer - redir end + let l:output = execute( + \ 'sign place ' . s:GroupCmd() . s:PriorityCmd() + \ . ' buffer=' . a:buffer + \ ) return split(l:output, "\n") endfunction 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 67dc971c..4a901488 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 @@ -568,6 +568,7 @@ Notes: * XML * `xmllint` * YAML + * `circleci`!! * `prettier` * `spectral` * `swaglint` diff --git a/sources_non_forked/ale/doc/ale-yaml.txt b/sources_non_forked/ale/doc/ale-yaml.txt index 04871403..65e0d069 100644 --- a/sources_non_forked/ale/doc/ale-yaml.txt +++ b/sources_non_forked/ale/doc/ale-yaml.txt @@ -1,6 +1,28 @@ =============================================================================== ALE YAML Integration *ale-yaml-options* + +=============================================================================== +circleci *ale-yaml-circleci* + +Website: https://circleci.com/docs/2.0/local-cli + + +Installation +------------------------------------------------------------------------------- + +Follow the instructions on the website, and make sure to test that you can +validate configuration files with: > + + circleci config validate - < .circleci/config.yml +< + +As long as the validator runs correctly, you should be able to see errors when +you save the configuration file. The validator doesn't run as you type because +it sends network requests, and running too often would overload the circleci +servers. + + =============================================================================== prettier *ale-yaml-prettier* @@ -15,11 +37,13 @@ Install prettier either globally or locally: > npm install prettier -g # global npm install prettier # local < + =============================================================================== spectral *ale-yaml-spectral* Website: https://github.com/stoplightio/spectral + Installation ------------------------------------------------------------------------------- @@ -80,6 +104,7 @@ g:ale_yaml_swaglint_use_global *g:ale_yaml_swaglint_use_global* See |ale-integrations-local-executables| + =============================================================================== yamlfix *ale-yaml-yamlfix* @@ -118,6 +143,7 @@ g:ale_yaml_yamlfix_use_global *g:ale_yaml_yamlfix_use_global* See |ale-integrations-local-executables| + =============================================================================== yamllint *ale-yaml-yamllint* diff --git a/sources_non_forked/ale/doc/ale.txt b/sources_non_forked/ale/doc/ale.txt index b7059af9..a126f360 100644 --- a/sources_non_forked/ale/doc/ale.txt +++ b/sources_non_forked/ale/doc/ale.txt @@ -561,7 +561,6 @@ vimrc, and your issues should go away. > set completeopt=menu,menuone,preview,noselect,noinsert < - Or alternatively, if you want to show documentation in popups: > set completeopt=menu,menuone,popup,noselect,noinsert @@ -3083,6 +3082,7 @@ documented in additional help files. xml.....................................|ale-xml-options| xmllint...............................|ale-xml-xmllint| yaml....................................|ale-yaml-options| + circleci..............................|ale-yaml-circleci| prettier..............................|ale-yaml-prettier| spectral..............................|ale-yaml-spectral| swaglint..............................|ale-yaml-swaglint| @@ -3734,6 +3734,21 @@ ale#fix#registry#Add(name, func, filetypes, desc, [aliases]) ALE will search for fixers in the registry first by `name`, then by their `aliases`. + For example to register a custom fixer for `luafmt`: > + + function! FormatLua(buffer) abort + return { + \ 'command': 'luafmt --stdin' + \} + endfunction + + execute ale#fix#registry#Add('luafmt', 'FormatLua', ['lua'], 'luafmt for lua') + + " You can now use it in g:ale_fixers + let g:ale_fixers = { + \ 'lua': ['luafmt'] + } +< ale#linter#Define(filetype, linter) *ale#linter#Define()* diff --git a/sources_non_forked/ale/supported-tools.md b/sources_non_forked/ale/supported-tools.md index 0f33006b..7848d111 100644 --- a/sources_non_forked/ale/supported-tools.md +++ b/sources_non_forked/ale/supported-tools.md @@ -577,6 +577,7 @@ formatting. * XML * [xmllint](http://xmlsoft.org/xmllint.html) * YAML + * [circleci](https://circleci.com/docs/2.0/local-cli) :floppy_disk: * [prettier](https://github.com/prettier/prettier) * [spectral](https://github.com/stoplightio/spectral) * [swaglint](https://github.com/byCedric/swaglint) diff --git a/sources_non_forked/lightline-ale/README.md b/sources_non_forked/lightline-ale/README.md index 152a3c2e..78a1e853 100644 --- a/sources_non_forked/lightline-ale/README.md +++ b/sources_non_forked/lightline-ale/README.md @@ -16,7 +16,7 @@ This plugin provides [ALE](https://github.com/w0rp/ale) indicator for the [light Install using a plugin manager of your choice, for example: ```viml -call dein#add('w0rp/ale') " Dependency: linter +call dein#add('dense-analysis/ale') " Dependency: linter call dein#add('itchyny/lightline.vim') " Dependency: status line call dein#add('maximbaz/lightline-ale') ``` diff --git a/sources_non_forked/vim-fugitive/autoload/fugitive.vim b/sources_non_forked/vim-fugitive/autoload/fugitive.vim index 26f1637c..cb8a5147 100644 --- a/sources_non_forked/vim-fugitive/autoload/fugitive.vim +++ b/sources_non_forked/vim-fugitive/autoload/fugitive.vim @@ -41,7 +41,7 @@ endfunction function! s:WinShellEsc(arg) abort if type(a:arg) == type([]) - return join(map(copy(a:arg), 's:shellesc(v:val)')) + return join(map(copy(a:arg), 's:WinShellEsc(v:val)')) elseif a:arg =~# '^[A-Za-z0-9_/:.-]\+$' return a:arg else @@ -1480,7 +1480,7 @@ function! fugitive#getfperm(url) abort return perm ==# '---------' ? '' : perm endfunction -function s:UpdateIndex(dir, info) abort +function! s:UpdateIndex(dir, info) abort let info = join(a:info[0:-2]) . "\t" . a:info[-1] . "\n" let [error, exec_error] = s:SystemError([a:dir, 'update-index', '--index-info'], info) return !exec_error ? '' : len(error) ? error : 'fugitive: unknown update-index error' @@ -2807,8 +2807,9 @@ function! fugitive#PagerFor(argv, ...) abort return 0 elseif type(value) == type('') return value - elseif args[0] =~# '^\%(branch\|config\|diff\|grep\|log\|range-diff\|reflog\|shortlog\|show\|tag\|whatchanged\)$' || + elseif args[0] =~# '^\%(branch\|config\|diff\|grep\|log\|range-diff\|shortlog\|show\|tag\|whatchanged\)$' || \ (args[0] ==# 'stash' && get(args, 1, '') ==# 'show') || + \ (args[0] ==# 'reflog' && get(args, 1, '') !~# '^\%(expire\|delete\|exists\)$') || \ (args[0] ==# 'am' && s:HasOpt(args, '--show-current-patch')) return 1 else @@ -2861,7 +2862,7 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort let name = substitute(get(args, 0, ''), '\%(^\|-\)\(\l\)', '\u\1', 'g') let git = s:UserCommandList() let options = {'git': git, 'dir': dir, 'flags': flags} - if pager is# -1 && exists('*s:' . name . 'Subcommand') && get(args, 1, '') !=# '--help' + if pager is# -1 && name =~# '^\a\+$' && exists('*s:' . name . 'Subcommand') && get(args, 1, '') !=# '--help' try let overrides = s:{name}Subcommand(a:line1, a:line2, a:range, a:bang, a:mods, extend({'subcommand': args[0], 'subcommand_args': args[1:-1]}, options)) if type(overrides) == type('') @@ -2936,7 +2937,7 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort call extend(env, {'COLUMNS': '' . &columns - 1}, 'keep') endif if s:RunJobs() && pager isnot# 1 - let state.pty = get(g:, 'fugitive_pty', has('unix') && !has('win32unix') && (has('patch-8.0.0744') || has('nvim'))) + let state.pty = get(g:, 'fugitive_pty', has('unix') && !has('win32unix') && (has('patch-8.0.0744') || has('nvim')) && fugitive#GitVersion() !~# '\.windows\>') if !state.pty let args = s:AskPassArgs(dir) + args endif @@ -2993,9 +2994,19 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort return 'call fugitive#Resume()|silent checktime' . after elseif pager is# 1 let pre = s:BuildEnvPrefix(env) - silent! execute '!' . escape(pre . s:UserCommand({'git': git, 'dir': dir}, s:disable_colors + flags + ['--no-pager'] + args), '!#%') . - \ (&shell =~# 'csh' ? ' >& ' . s:shellesc(state.file) : ' > ' . s:shellesc(state.file) . ' 2>&1') - let state.exit_status = v:shell_error + try + if exists('+guioptions') && &guioptions =~# '!' + let guioptions = &guioptions + set guioptions-=! + endif + silent! execute '!' . escape(pre . s:UserCommand({'git': git, 'dir': dir}, s:disable_colors + flags + ['--no-pager'] + args), '!#%') . + \ (&shell =~# 'csh' ? ' >& ' . s:shellesc(state.file) : ' > ' . s:shellesc(state.file) . ' 2>&1') + let state.exit_status = v:shell_error + finally + if exists('guioptions') + let &guioptions = guioptions + endif + endtry redraw! call s:RunSave(state) call s:RunFinished(state) @@ -3968,7 +3979,7 @@ function! s:StageApply(info, reverse, extra) abort endif endwhile if start == 0 - throw 'fugitive: cold not find hunk' + throw 'fugitive: could not find hunk' elseif getline(start) !~# '^@@ ' throw 'fugitive: cannot apply conflict hunk' endif @@ -5487,8 +5498,6 @@ function! fugitive#Diffsplit(autodir, keepfocus, mods, arg, args) abort set diffopt-=vertical endif execute mods 'diffsplit' s:fnameescape(spec) - let &l:readonly = &l:readonly - redraw let w:fugitive_diff_restore = restore let winnr = winnr() if getwinvar('#', '&diff') diff --git a/sources_non_forked/vim-fugitive/ftplugin/fugitiveblame.vim b/sources_non_forked/vim-fugitive/ftplugin/fugitiveblame.vim index 6fe0a14d..1037b093 100644 --- a/sources_non_forked/vim-fugitive/ftplugin/fugitiveblame.vim +++ b/sources_non_forked/vim-fugitive/ftplugin/fugitiveblame.vim @@ -1,4 +1,4 @@ -if exists("b:did_ftplugin") || !exists('*fugitive#BlameFileType') +if exists("b:did_ftplugin") || !exists("*FugitiveGitDir") finish endif let b:did_ftplugin = 1 diff --git a/sources_non_forked/vim-fugitive/syntax/fugitiveblame.vim b/sources_non_forked/vim-fugitive/syntax/fugitiveblame.vim index c06d19e0..70c1e745 100644 --- a/sources_non_forked/vim-fugitive/syntax/fugitiveblame.vim +++ b/sources_non_forked/vim-fugitive/syntax/fugitiveblame.vim @@ -1,4 +1,4 @@ -if exists("b:current_syntax") +if exists("b:current_syntax") || !exists("*FugitiveGitDir") finish endif diff --git a/sources_non_forked/vim-gitgutter/README.mkd b/sources_non_forked/vim-gitgutter/README.mkd index 27fc7116..5bf9285e 100644 --- a/sources_non_forked/vim-gitgutter/README.mkd +++ b/sources_non_forked/vim-gitgutter/README.mkd @@ -77,13 +77,16 @@ nvim -u NONE -c "helptags vim-gitgutter/doc" -c q ### Windows -I recommend configuring vim-gitgutter with the full path to your git executable. For example: +There is a potential risk on Windows due to `cmd.exe` prioritising the current folder over folders in `PATH`. If you have a file named `git.*` (i.e. with any extension in `PATHEXT`) in your current folder, it will be executed instead of git whenever the plugin calls git. + +You can avoid this risk by configuring the full path to your git executable. For example: ```viml +" This path probably won't work let g:gitgutter_git_executable = 'C:\Program Files\Git\bin\git.exe' ``` -This is to avoid a problem which occurs if you have file named `git.*` (i.e. with any extension in `PATHEXT`) in your current folder. `cmd.exe` prioritises the current folder over folders in `PATH` and will try to execute your file instead of the `git` binary. +Unfortunately I don't know the correct escaping for the path - if you do, please let me know! ### Getting started diff --git a/sources_non_forked/vim-gitgutter/autoload/gitgutter/hunk.vim b/sources_non_forked/vim-gitgutter/autoload/gitgutter/hunk.vim index f530e3e4..28059c06 100644 --- a/sources_non_forked/vim-gitgutter/autoload/gitgutter/hunk.vim +++ b/sources_non_forked/vim-gitgutter/autoload/gitgutter/hunk.vim @@ -64,7 +64,7 @@ function! gitgutter#hunk#next_hunk(count) abort if g:gitgutter_show_msg_on_hunk_jumping redraw | echo printf('Hunk %d of %d', index(hunks, hunk) + 1, len(hunks)) endif - if s:is_preview_window_open() + if gitgutter#hunk#is_preview_window_open() call gitgutter#hunk#preview() endif return @@ -95,7 +95,7 @@ function! gitgutter#hunk#prev_hunk(count) abort if g:gitgutter_show_msg_on_hunk_jumping redraw | echo printf('Hunk %d of %d', index(hunks, hunk) + 1, len(hunks)) endif - if s:is_preview_window_open() + if gitgutter#hunk#is_preview_window_open() call gitgutter#hunk#preview() endif return @@ -249,7 +249,7 @@ function! s:hunk_op(op, ...) let hunk_diff = join(hunk_header + hunk_body, "\n")."\n" call s:goto_original_window() - call s:close_hunk_preview_window() + call gitgutter#hunk#close_hunk_preview_window() call s:stage(hunk_diff) endif @@ -427,7 +427,7 @@ endfunction function! s:open_hunk_preview_window() if g:gitgutter_preview_win_floating if exists('*nvim_open_win') - call s:close_hunk_preview_window() + call gitgutter#hunk#close_hunk_preview_window() let buf = nvim_create_buf(v:false, v:false) " Set default width and height for now. @@ -446,9 +446,15 @@ function! s:open_hunk_preview_window() call nvim_buf_set_name(buf, 'gitgutter://hunk-preview') " Assumes cursor is in original window. - autocmd CursorMoved ++once call s:close_hunk_preview_window() + autocmd CursorMoved ++once call gitgutter#hunk#close_hunk_preview_window() + if g:gitgutter_close_preview_on_escape - nnoremap :call close_hunk_preview_window() + " Map to close the floating preview. + nnoremap :call gitgutter#hunk#close_hunk_preview_window() + " Ensure that when the preview window is closed, the map is removed. + autocmd User GitGutterPreviewClosed silent! nunmap + autocmd CursorMoved ++once silent! nunmap + execute "autocmd WinClosed doautocmd" s:nomodeline "User GitGutterPreviewClosed" endif return @@ -584,7 +590,7 @@ function! s:goto_original_window() endfunction -function! s:close_hunk_preview_window() +function! gitgutter#hunk#close_hunk_preview_window() let bufnr = s:winid != 0 ? winbufnr(s:winid) : s:preview_bufnr call setbufvar(bufnr, '&modified', 0) @@ -601,12 +607,17 @@ function! s:close_hunk_preview_window() endfunction -" Only makes sense for traditional, non-floating preview window. -function s:is_preview_window_open() - for i in range(1, winnr('$')) - if getwinvar(i, '&previewwindow') - return 1 +function gitgutter#hunk#is_preview_window_open() + if g:gitgutter_preview_win_floating + if win_id2win(s:winid) > 0 + execute win_id2win(s:winid).'wincmd c' endif - endfor + else + for i in range(1, winnr('$')) + if getwinvar(i, '&previewwindow') + return 1 + endif + endfor + endif return 0 endfunction diff --git a/sources_non_forked/vim-gitgutter/doc/gitgutter.txt b/sources_non_forked/vim-gitgutter/doc/gitgutter.txt index 05bd2ce2..56a96336 100644 --- a/sources_non_forked/vim-gitgutter/doc/gitgutter.txt +++ b/sources_non_forked/vim-gitgutter/doc/gitgutter.txt @@ -63,15 +63,20 @@ Neovim:~ =============================================================================== WINDOWS *gitgutter-windows* -I recommend configuring vim-gitgutter with the full path to your git executable. +There is a potential risk on Windows due to `cmd.exe` prioritising the current +folder over folders in `PATH`. If you have a file named `git.*` (i.e. with +any extension in `PATHEXT`) in your current folder, it will be executed +instead of git whenever the plugin calls git. + +You can avoid this risk by configuring the full path to your git executable. For example: > + " This path probably won't work let g:gitgutter_git_executable = 'C:\Program Files\Git\bin\git.exe' < -This is to avoid a problem which occurs if you have file named "git.*" (i.e. -with any extension in "PATHEXT") in your current folder. "cmd.exe" prioritises -the current folder over folders in 'PATH' and will try to execute your file -instead of the "git" binary. + +Unfortunately I don't know the correct escaping for the path - if you do, +please let me know! =============================================================================== @@ -190,6 +195,12 @@ Commands for operating on a hunk:~ the original window with |CTRL-W_p|. Alternatively set |g:gitgutter_close_preview_on_escape| and use . + Two functions are available for your own logic: +> + gitgutter#hunk#is_preview_window_open() + gitgutter#hunk#close_hunk_preview_window() +< + Commands for folds:~ *gitgutter-:GitGutterFold* diff --git a/sources_non_forked/vim-ruby/spec/syntax/symbols_spec.rb b/sources_non_forked/vim-ruby/spec/syntax/symbols_spec.rb index b0aad72e..92b314b7 100644 --- a/sources_non_forked/vim-ruby/spec/syntax/symbols_spec.rb +++ b/sources_non_forked/vim-ruby/spec/syntax/symbols_spec.rb @@ -42,4 +42,12 @@ describe "Syntax highlighting" do validates_inclusion_of :gender, in: %w(male female), if: :gender_required? EOF end + + specify "nested parentheses inside symbols" do + assert_correct_highlighting <<~EOF, 'bar\zs)', 'rubySymbol' + h = %i( + foo(bar)baz + ) + EOF + end end diff --git a/sources_non_forked/vim-ruby/spec/vim/plugin/syntax_test.vim b/sources_non_forked/vim-ruby/spec/vim/plugin/syntax_test.vim index db84204c..6b9bb74c 100644 --- a/sources_non_forked/vim-ruby/spec/vim/plugin/syntax_test.vim +++ b/sources_non_forked/vim-ruby/spec/vim/plugin/syntax_test.vim @@ -2,7 +2,7 @@ let s:debug = 0 function! s:CursorHasGroup(group) abort - return synIDattr(synID(line('.'), col('.'), 0), 'name') =~ a:group + return synIDattr(synID(line('.'), col('.'), 1), 'name') =~ a:group endfunction function! TestSyntax(pattern, group) abort diff --git a/sources_non_forked/vim-ruby/syntax/ruby.vim b/sources_non_forked/vim-ruby/syntax/ruby.vim index d797e46b..149f13cf 100644 --- a/sources_non_forked/vim-ruby/syntax/ruby.vim +++ b/sources_non_forked/vim-ruby/syntax/ruby.vim @@ -133,10 +133,10 @@ syn match rubyCurlyBraceEscape "\\[{}]" contained display syn match rubyAngleBracketEscape "\\[<>]" contained display syn match rubySquareBracketEscape "\\[[\]]" contained display -syn region rubyNestedParentheses start="(" skip="\\\\\|\\)" matchgroup=rubyString end=")" transparent contained -syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" matchgroup=rubyString end="}" transparent contained -syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" matchgroup=rubyString end=">" transparent contained -syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" matchgroup=rubyString end="\]" transparent contained +syn region rubyNestedParentheses start="(" skip="\\\\\|\\)" end=")" transparent contained +syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" end="}" transparent contained +syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" end=">" transparent contained +syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" end="\]" transparent contained syn cluster rubySingleCharEscape contains=rubyBackslashEscape,rubyQuoteEscape,rubySpaceEscape,rubyParenthesisEscape,rubyCurlyBraceEscape,rubyAngleBracketEscape,rubySquareBracketEscape syn cluster rubyNestedBrackets contains=rubyNested.\+ diff --git a/sources_non_forked/vim-snipmate/doc/snipMate.txt b/sources_non_forked/vim-snipmate/doc/snipMate.txt index 52cc5b83..62265a00 100644 --- a/sources_non_forked/vim-snipmate/doc/snipMate.txt +++ b/sources_non_forked/vim-snipmate/doc/snipMate.txt @@ -532,7 +532,7 @@ sources such as creating snippets on the fly representing python function definitions found in the current file. Example 2:~ -Add to your ~/.vimrc: For each know snippet add a second version ending in _ +Add to your ~/.vimrc: For each new snippet add a second version ending in _ adding folding markers > let g:commentChar = { diff --git a/sources_non_forked/vim-snippets/UltiSnips/julia.snippets b/sources_non_forked/vim-snippets/UltiSnips/julia.snippets index 259c5f4c..e0b4a9a8 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/julia.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/julia.snippets @@ -32,3 +32,12 @@ endsnippet snippet fld "type field documentation" b #' @field ${1:name}::${2:Type} ${0:Description} endsnippet + +# Debugging +snippet deb "Debugger breakpoint" b +Main.@bp +endsnippet + +snippet inf "Infiltrator breakpoint" b +Main.@infiltrate +endsnippet diff --git a/sources_non_forked/vim-snippets/snippets/python.snippets b/sources_non_forked/vim-snippets/snippets/python.snippets index cd1224df..891f905f 100644 --- a/sources_non_forked/vim-snippets/snippets/python.snippets +++ b/sources_non_forked/vim-snippets/snippets/python.snippets @@ -241,7 +241,7 @@ snippet addsp snippet addarg parser.add_argument("${0:short_arg}", "${1:long_arg}", default=${2:None}, help="${3:Help text}") snippet addnarg - parser.add_argument("${0:arg}", nargs="${1:*}", default"${2:None}, help="${3:Help text}") + parser.add_argument("${0:arg}", nargs="${1:*}", default=${2:None}, help="${3:Help text}") snippet addaarg parser.add_argument("${0:arg}", "${1:long_arg}", action="${2:store_true}", default=${3:False}, help="${4:Help text}") snippet pargs diff --git a/sources_non_forked/vim-snippets/snippets/rust.snippets b/sources_non_forked/vim-snippets/snippets/rust.snippets index 71fe5909..5e9eb2b1 100644 --- a/sources_non_forked/vim-snippets/snippets/rust.snippets +++ b/sources_non_forked/vim-snippets/snippets/rust.snippets @@ -101,7 +101,7 @@ snippet crate "Define create meta attributes" // Crate name #![crate_name = "${1:crate_name}"] // Additional metadata attributes - #![desc = "${2:Descrption.}"] + #![desc = "${2:Description.}"] #![license = "${3:BSD}"] #![comment = "${4:Comment.}"] // Specify the output type diff --git a/sources_non_forked/vim-snippets/snippets/vue.snippets b/sources_non_forked/vim-snippets/snippets/vue.snippets index 61c06af6..1385ecb7 100644 --- a/sources_non_forked/vim-snippets/snippets/vue.snippets +++ b/sources_non_forked/vim-snippets/snippets/vue.snippets @@ -118,7 +118,7 @@ snippet vfilter snippet vfor
{{ $1 }} -
snippet vgetters getters: {