From 395c077dcbe2b9e997a9e3de854ea2835e703489 Mon Sep 17 00:00:00 2001 From: amix Date: Tue, 14 Mar 2017 16:16:07 +0100 Subject: [PATCH] Updated plugins --- sources_non_forked/goyo.vim/autoload/goyo.vim | 2 +- .../vim-commentary/plugin/commentary.vim | 4 +- .../vim-go/.github/CONTRIBUTING.md | 2 +- sources_non_forked/vim-go/CHANGELOG.md | 27 +++++++-- sources_non_forked/vim-go/autoload/go/cmd.vim | 22 ++++++++ .../vim-go/autoload/go/guru.vim | 24 +------- .../vim-go/autoload/go/rename.vim | 6 ++ sources_non_forked/vim-go/doc/vim-go.txt | 27 ++++----- .../vim-go/ftplugin/go/commands.vim | 2 +- sources_non_forked/vim-pug/syntax/pug.vim | 10 ++-- .../vim-snipmate/autoload/snipMate.vim | 11 +++- .../vim-snipmate/autoload/snipmate/parse.vim | 20 ++++++- sources_non_forked/vim-snipmate/t/parser.vim | 10 ++++ .../vim-snippets/UltiSnips/cs.snippets | 56 +++++++++++++++++-- .../vim-snippets/snippets/cs.snippets | 14 ++--- 15 files changed, 170 insertions(+), 67 deletions(-) diff --git a/sources_non_forked/goyo.vim/autoload/goyo.vim b/sources_non_forked/goyo.vim/autoload/goyo.vim index 735c950a..94216d1a 100644 --- a/sources_non_forked/goyo.vim/autoload/goyo.vim +++ b/sources_non_forked/goyo.vim/autoload/goyo.vim @@ -33,7 +33,7 @@ function! s:get_color(group, attr) endfunction function! s:set_color(group, attr, color) - let gui = a:color =~ '^#' + let gui = has('gui_running') || has('termguicolors') && &termguicolors execute printf('hi %s %s%s=%s', a:group, gui ? 'gui' : 'cterm', a:attr, a:color) endfunction diff --git a/sources_non_forked/vim-commentary/plugin/commentary.vim b/sources_non_forked/vim-commentary/plugin/commentary.vim index 0bef7cc9..a7b0ced7 100644 --- a/sources_non_forked/vim-commentary/plugin/commentary.vim +++ b/sources_non_forked/vim-commentary/plugin/commentary.vim @@ -96,7 +96,9 @@ if !hasmapto('Commentary') || maparg('gc','n') ==# '' nmap gc Commentary omap gc Commentary nmap gcc CommentaryLine - nmap cgc ChangeCommentary + if maparg('c','n') ==# '' + nmap cgc ChangeCommentary + endif nmap gcu CommentaryCommentary endif diff --git a/sources_non_forked/vim-go/.github/CONTRIBUTING.md b/sources_non_forked/vim-go/.github/CONTRIBUTING.md index 7266ccea..450f9598 100644 --- a/sources_non_forked/vim-go/.github/CONTRIBUTING.md +++ b/sources_non_forked/vim-go/.github/CONTRIBUTING.md @@ -4,6 +4,6 @@ Thanks for improving vim-go! Before you dive in please read the following: [FAQ](https://github.com/fatih/vim-go/wiki/FAQ-Troubleshooting), it might have answers for your problem 2. If you add a new feature please don't forget to update the documentation: - [doc/vim-go.txt](doc/vim-go.txt) + [doc/vim-go.txt](https://github.com/fatih/vim-go/blob/master/doc/vim-go.txt) 3. If it's a breaking change or exceed +100 lines please open an issue first and describe the changes you want to make. diff --git a/sources_non_forked/vim-go/CHANGELOG.md b/sources_non_forked/vim-go/CHANGELOG.md index 46662bc8..9d245fc2 100644 --- a/sources_non_forked/vim-go/CHANGELOG.md +++ b/sources_non_forked/vim-go/CHANGELOG.md @@ -2,7 +2,11 @@ FEATURES: -* New `:GoAddTags` and `:GoRemoveTags` command based on the tool [gomodifytags](https://github.com/fatih/gomodifytags). This fixes many old bugs that were due prior regexp based implementation. For the usage please read the docs and checkout the demo at: https://github.com/fatih/vim-go/pull/1204 [gh-1204] +* New `:GoAddTags` and `:GoRemoveTags` command based on the tool + [gomodifytags](https://github.com/fatih/gomodifytags). This fixes many old + bugs that were due prior regexp based implementation. For the usage please + read the docs and checkout the demo at: + https://github.com/fatih/vim-go/pull/1204 [gh-1204] * Add new `errl` snippet that expands to [gh-1185]: ``` @@ -10,12 +14,16 @@ if err != nil { log.Fatal(err) } ``` +* New `:GoBuildTags` command to change build tags for tools such as `guru`, + `gorename`, etc ... There is also a new setting called `g:go_build_tags` + [gh-1232] IMPROVEMENTS: -* Lowercase `` in mappings examples for consisten documentation across the README [gh-1192] +* Lowercase `` in mappings examples for consistent documentation across the README [gh-1192] * All of files should be written in utf-8 if the file will be passed to external command. [gh-1184] -* `:GoAddTags` is now able to add options to existing tags with the syntax `:GoAddTags key,option`, i.e: `:GoAddTags json,omitempty` [gh-985] +* `:GoAddTags` is now able to add options to existing tags with the syntax + `:GoAddTags key,option`, i.e: `:GoAddTags json,omitempty` [gh-985] * Document 'noshowmode' requirement for echo_go_info [gh-1197] * Improve godoc view for vertical splits [gh-1195] * Set GOPATH for both possible go guru execution paths (sync and async) [gh-1193] @@ -23,7 +31,8 @@ IMPROVEMENTS: BUG FIXES: * Honor `g:go_echo_command_info` when dispatching builds in neovim [gh-1176] -* Fix `:GoBuild` error in neovim due to invalid jobcontrol handler function signatures (`s:on_stdout`, `s:on_stderr`)[gh-1176] +* Fix `:GoBuild` error in neovim due to invalid jobcontrol handler function + signatures (`s:on_stdout`, `s:on_stderr`)[gh-1176] * Update statusline before and after `go#jobcontrol#Spawn` command is executed [gh-1176] * Correctly report the value of the 'g:go_guru_tags' variable [gh-1177] * Ensure no trailing `:` exist in GOPATH detection if initial GOPATH is not set [gh-1194] @@ -36,12 +45,20 @@ BUG FIXES: * Respect go_fmt_options when running goimports [gh-1211] * Set the filename in the location-list when there is an error with :GoFmt [gh-1199] +BACKWARDS INCOMPATIBILITIES: + +* The command `:GoGuruTags` is removed in favour of the new command + `:GoBuildTags`. This command will be used now not just for `guru`, also for + all new commands such as `guru` [gh-1232] +* The setting `g:go_guru_tags` is removed in favour of the new setting + `g:go_build_tags` [gh-1232] + ## 1.11 - (January 9, 2017) FEATURES: -* Travis test integration has been added. Now any file that is added as `_test.vim` will be automatically tested in for every Pull Request (just like how we add tests to Go with `_test.go`). Going forward this will tremendously increase the stability and decrease the maintaince burden of vim-go. [gh-1157] +* Travis test integration has been added. Now any file that is added as `_test.vim` will be automatically tested in for every Pull Request (just like how we add tests to Go with `_test.go`). Going forward this will tremendously increase the stability and decrease the maintenance burden of vim-go. [gh-1157] * Add new `g:go_updatetime` setting to change the default updatetime (which was hardcoded previously) [gh-1055] * Add new `g:go_template_use_pkg` setting to enable to use cwd as package name instead of basic template file [gh-1124] diff --git a/sources_non_forked/vim-go/autoload/go/cmd.vim b/sources_non_forked/vim-go/autoload/go/cmd.vim index badca313..02e8e102 100644 --- a/sources_non_forked/vim-go/autoload/go/cmd.vim +++ b/sources_non_forked/vim-go/autoload/go/cmd.vim @@ -76,6 +76,28 @@ function! go#cmd#Build(bang, ...) abort endfunction +" BuildTags sets or shows the current build tags used for tools +function! go#cmd#BuildTags(bang, ...) abort + if a:0 + if a:0 == 1 && a:1 == '""' + unlet g:go_build_tags + call go#util#EchoSuccess("build tags are cleared") + else + let g:go_build_tags = a:1 + call go#util#EchoSuccess("build tags are changed to: ". a:1) + endif + + return + endif + + if !exists('g:go_build_tags') + call go#util#EchoSuccess("build tags are not set") + else + call go#util#EchoSuccess("current build tags: ". g:go_build_tags) + endif +endfunction + + " Run runs the current file (and their dependencies if any) in a new terminal. function! go#cmd#RunTerm(bang, mode, files) abort if empty(a:files) diff --git a/sources_non_forked/vim-go/autoload/go/guru.vim b/sources_non_forked/vim-go/autoload/go/guru.vim index df31d1b3..7edd6716 100644 --- a/sources_non_forked/vim-go/autoload/go/guru.vim +++ b/sources_non_forked/vim-go/autoload/go/guru.vim @@ -46,8 +46,8 @@ function! s:guru_cmd(args) range abort endif " check for any tags - if exists('g:go_guru_tags') - let tags = get(g:, 'go_guru_tags') + if exists('g:go_build_tags') + let tags = get(g:, 'go_build_tags') call extend(cmd, ["-tags", tags]) let result.tags = tags endif @@ -619,24 +619,4 @@ function! go#guru#Scope(...) abort endif endfunction -function! go#guru#Tags(...) abort - if a:0 - if a:0 == 1 && a:1 == '""' - unlet g:go_guru_tags - call go#util#EchoSuccess("guru tags is cleared") - else - let g:go_guru_tags = a:1 - call go#util#EchoSuccess("guru tags changed to: ". a:1) - endif - - return - endif - - if !exists('g:go_guru_tags') - call go#util#EchoSuccess("guru tags is not set") - else - call go#util#EchoSuccess("current guru tags: ". g:go_guru_tags) - endif -endfunction - " vim: sw=2 ts=2 et diff --git a/sources_non_forked/vim-go/autoload/go/rename.vim b/sources_non_forked/vim-go/autoload/go/rename.vim index 7d5579d2..ac2f0181 100644 --- a/sources_non_forked/vim-go/autoload/go/rename.vim +++ b/sources_non_forked/vim-go/autoload/go/rename.vim @@ -41,6 +41,12 @@ function! go#rename#Rename(bang, ...) abort let cmd = [bin_path, "-offset", offset, "-to", to_identifier] + " check for any tags + if exists('g:go_build_tags') + let tags = get(g:, 'go_build_tags') + call extend(cmd, ["-tags", tags]) + endif + if go#util#has_job() call go#util#EchoProgress(printf("renaming to '%s' ...", to_identifier)) call s:rename_job({ diff --git a/sources_non_forked/vim-go/doc/vim-go.txt b/sources_non_forked/vim-go/doc/vim-go.txt index d37df28f..29be99f5 100644 --- a/sources_non_forked/vim-go/doc/vim-go.txt +++ b/sources_non_forked/vim-go/doc/vim-go.txt @@ -598,15 +598,16 @@ CTRL-t use the variable |'g:go_metalinter_command'|. To override the maximum linters execution time use |'g:go_metalinter_deadline'| variable. - *:GoGuruTags* -:GoGuruTags [tags] + *:GoBuildTags* +:GoBuildTags [tags] - Changes the custom |'g:go_guru_tags'| setting and overrides it with the - given build tags. This command cooperate with GoReferrers command when - there exist mulitiple build tags in your project, then you can set one of - the build tags for GoReferrers to find more accurate. - The custom build tags is cleared (unset) if `""` is given. If no arguments - is given it prints the current custom build tags. + Changes the build tags for various commands. If you have any file that + uses a custom build tag, such as `//+build integration` , this command can + be used to pass it to all tools that accepts tags, such as guru, gorenate, + etc.. + + The build tags is cleared (unset) if `""` is given. If no arguments is + given it prints the current custom build tags. *:AsmFmt* :AsmFmt @@ -1208,15 +1209,15 @@ set, so the relevant commands defaults are being used. > let g:go_guru_scope = [] < - *'g:go_guru_tags'* + *'g:go_build_tags'* These options that will be automatically passed to the `-tags` option of -`go guru` when it's invoked with |:GoDef|. You can use |:GoGuruTags| to set -this. By default it's not set. +various tools, such as `guru`, `gorename`, etc... This is a permanatent +setting. A more useful way is to use |:GoBuildTags| to dynamically change or +remove build tags. By default it's not set. > - let g:go_guru_tags = '' + let g:go_build_tags = '' < - *'g:go_highlight_array_whitespace_error'* Highlights white space after "[]". > diff --git a/sources_non_forked/vim-go/ftplugin/go/commands.vim b/sources_non_forked/vim-go/ftplugin/go/commands.vim index 6f108a67..f5357d2a 100644 --- a/sources_non_forked/vim-go/ftplugin/go/commands.vim +++ b/sources_non_forked/vim-go/ftplugin/go/commands.vim @@ -12,7 +12,6 @@ command! -range=% GoCallstack call go#guru#Callstack() command! -range=% GoFreevars call go#guru#Freevars() command! -range=% GoChannelPeers call go#guru#ChannelPeers() command! -range=% GoReferrers call go#guru#Referrers() -command! -nargs=? GoGuruTags call go#guru#Tags() command! -range=0 GoSameIds call go#guru#SameIds() command! -range=0 GoSameIdsClear call go#guru#ClearSameIds() @@ -31,6 +30,7 @@ command! -nargs=0 GoAutoTypeInfoToggle call go#complete#ToggleAutoTypeInfo() " -- cmd command! -nargs=* -bang GoBuild call go#cmd#Build(0,) +command! -nargs=? -bang GoBuildTags call go#cmd#BuildTags(0, ) command! -nargs=* -bang GoGenerate call go#cmd#Generate(0,) command! -nargs=* -bang -complete=file GoRun call go#cmd#Run(0,) command! -nargs=* -bang GoInstall call go#cmd#Install(0, ) diff --git a/sources_non_forked/vim-pug/syntax/pug.vim b/sources_non_forked/vim-pug/syntax/pug.vim index 9e5ea3da..0fb146d8 100644 --- a/sources_non_forked/vim-pug/syntax/pug.vim +++ b/sources_non_forked/vim-pug/syntax/pug.vim @@ -33,9 +33,9 @@ syn match pugBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=pugTag,pugClassChar,p syn match pugTag "+\?[[:alnum:]_-]\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@pugComponent syn cluster pugComponent contains=pugAttributes,pugIdChar,pugBlockExpansionChar,pugClassChar,pugPlainChar,pugJavascript,pugTagBlockChar,pugTagInlineText syntax keyword pugCommentTodo contained TODO FIXME XXX TBD -syn match pugComment '\(\s\+\|^\)\/\/.*$' contains=pugCommentTodo -syn region pugCommentBlock start="\z(\s\+\|^\)\/\/.*$" end="^\%(\z1\s\|\s*$\)\@!" contains=pugCommentTodo keepend -syn region pugHtmlConditionalComment start="" contains=pugCommentTodo +syn match pugComment '\(\s\+\|^\)\/\/.*$' contains=pugCommentTodo,@Spell +syn region pugCommentBlock start="\z(\s\+\|^\)\/\/.*$" end="^\%(\z1\s\|\s*$\)\@!" contains=pugCommentTodo,@Spell keepend +syn region pugHtmlConditionalComment start="" contains=pugCommentTodo,@Spell syn region pugAngular2 start="(" end=")" contains=htmlEvent syn region pugAttributes matchgroup=pugAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,pugHtmlArg,pugAngular2,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@pugComponent syn match pugClassChar "\." containedin=htmlTagName nextgroup=pugClass @@ -52,10 +52,10 @@ syn keyword pugHtmlArg contained href title syn match pugPlainChar "\\" contained syn region pugInterpolation matchgroup=pugInterpolationDelimiter start="[#!]{" end="}" contains=@htmlJavascript syn match pugInterpolationEscape "\\\@:h:h').'/README.md' + echoe "tlib is missing. See install instructions at ".expand(':h:h').'/README.md' endtry fun! Filename(...) abort @@ -117,7 +117,14 @@ function! snipMate#sniplist_str(snippet, stops) abort if type(item) == type('') let str .= item elseif type(item) == type([]) - let str .= snipMate#placeholder_str(item[0], a:stops) + let placeholder = snipMate#placeholder_str(item[0], a:stops) + if len(item) > 1 && type(item[1]) == type({}) + let placeholder = substitute(placeholder, + \ get(item[1], 'pat', ''), + \ get(item[1], 'sub', ''), + \ get(item[1], 'flags', '')) + endif + let str .= placeholder endif let pos += 1 diff --git a/sources_non_forked/vim-snipmate/autoload/snipmate/parse.vim b/sources_non_forked/vim-snipmate/autoload/snipmate/parse.vim index dd495e95..5f842609 100644 --- a/sources_non_forked/vim-snipmate/autoload/snipmate/parse.vim +++ b/sources_non_forked/vim-snipmate/autoload/snipmate/parse.vim @@ -171,6 +171,7 @@ endfunction function! s:parser_text(till) dict abort let ret = [] + let target = ret while self.pos < self.len let lines = [] @@ -180,8 +181,12 @@ function! s:parser_text(till) dict abort if !empty(var) if var[0] is# 'VISUAL' let lines = s:visual_placeholder(var, self.indent) + " Remove trailing newline. See #245 + if lines[-1] == '' && self.next == "\n" + call remove(lines, -1) + endif elseif var[0] >= 0 - call add(ret, var) + call add(target, var) call self.add_var(var) endif endif @@ -192,8 +197,12 @@ function! s:parser_text(till) dict abort endif if !empty(lines) - call add(ret, lines[0]) - call extend(self.stored_lines, lines[1:]) + call add(target, lines[0]) + call extend(self.stored_lines, lines[1:-2]) + " Don't change targets if there's only one line + if exists("lines[1]") + let target = [lines[-1]] + endif endif " Empty lines are ignored if this is tested at the start of an iteration @@ -203,6 +212,11 @@ function! s:parser_text(till) dict abort endwhile call s:join_consecutive_strings(ret) + if target isnot ret + call s:join_consecutive_strings(target) + call extend(self.stored_lines, target) + endif + return ret endfunction diff --git a/sources_non_forked/vim-snipmate/t/parser.vim b/sources_non_forked/vim-snipmate/t/parser.vim index c5cf8739..3c2aa6e5 100644 --- a/sources_non_forked/vim-snipmate/t/parser.vim +++ b/sources_non_forked/vim-snipmate/t/parser.vim @@ -118,6 +118,16 @@ describe 'snippet parser' \ ["\t baz"], ["x"]] end + it 'removes newlines from the end of VISUALs if before an end of line' + let b:snipmate_visual = "1\n2\n" + Expect Parse("x\n$VISUAL\nx") == [['x'], ['1'], ['2'], ['x']] + end + + it 'splits the before and after a $VISUAL if it is multiline' + let b:snipmate_visual = "1\n2\n3" + Expect Parse("foo $VISUAL bar") == [['foo 1'], ['2'], ['3 bar']] + end + it 'determines which var with an id is the stop' let [snip, stops] = Parse("$1$1$1", 0, 1) Expect snip == [[[1, "", stops[1]], [1, {}], [1, {}]]] diff --git a/sources_non_forked/vim-snippets/UltiSnips/cs.snippets b/sources_non_forked/vim-snippets/UltiSnips/cs.snippets index 89b61ca0..298eefd2 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/cs.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/cs.snippets @@ -16,7 +16,7 @@ namespace ${1:MyNamespace} endsnippet snippet class "class" w -class ${1:MyClass} +${1:public} class ${2:MyClass} { $0 } @@ -288,6 +288,10 @@ snippet cw "Console.WriteLine" b Console.WriteLine("$1"); endsnippet +snippet cr "Console.ReadLine" b +Console.ReadLine(); +endsnippet + # as you first type comma-separated parameters on the right, {n} values appear in the format string snippet cwp "Console.WriteLine with parameters" b Console.WriteLine("${2:`!p @@ -300,9 +304,9 @@ MessageBox.Show("${1:message}"); endsnippet -################## -# full methods # -################## +############# +# methods # +############# snippet equals "Equals method" b public override bool Equals(object obj) @@ -316,13 +320,53 @@ public override bool Equals(object obj) } endsnippet +snippet mth "Method" b +${1:public} ${2:void} ${3:MyMethod}(${4}) +{ + $0 +} +endsnippet + +snippet mths "Static method" b +${1:public} static ${2:void} ${3:MyMethod}(${4}) +{ + $0 +} +endsnippet + +############### +# constructor # +############### + +snippet ctor "Constructor" b +${1:public} ${2:`!p snip.rv = snip.basename or "untitled"`}(${3}) +{ + $0 +} +endsnippet ############## # comments # ############## -snippet /// "XML comment" b +snippet /// "XML summary comment" b /// -/// $1 +/// $0 /// endsnippet + +snippet

${2} +endsnippet + +snippet ${2} +endsnippet + +snippet $0 +endsnippet + +snippet $0 +endsnippet diff --git a/sources_non_forked/vim-snippets/snippets/cs.snippets b/sources_non_forked/vim-snippets/snippets/cs.snippets index 391984bb..decf79af 100644 --- a/sources_non_forked/vim-snippets/snippets/cs.snippets +++ b/sources_non_forked/vim-snippets/snippets/cs.snippets @@ -56,7 +56,7 @@ # # Feedback is welcome! # -# Main +# Main snippet sim ${1:public }static int Main(string[] args) { ${0} @@ -358,7 +358,7 @@ snippet enum enum ${1} { ${0} } - + snippet enum+ public enum ${1} { ${0} @@ -378,7 +378,7 @@ snippet

${2} snippet ${1}{ + ${1} snippet snippet