mirror of
1
0
Fork 0

Updated plugins

This commit is contained in:
Amir 2020-06-21 11:50:44 -04:00
parent 1d312d3252
commit e83f5ea2e7
46 changed files with 470 additions and 152 deletions

View File

@ -32,14 +32,29 @@ function! ale_linters#dockerfile#dockerfile_lint#Handle(buffer, lines) abort
let l:line = get(l:object, 'line', -1) let l:line = get(l:object, 'line', -1)
let l:message = l:object['message'] let l:message = l:object['message']
if get(l:object, 'description', 'None') isnot# 'None' let l:link = get(l:object, 'reference_url', '')
let l:message = l:message . '. ' . l:object['description']
if type(l:link) == v:t_list
" Somehow, reference_url is returned as two-part list.
" Anchor markers in that list are sometimes duplicated.
" See https://github.com/projectatomic/dockerfile_lint/issues/134
let l:link = join(l:link, '')
let l:link = substitute(l:link, '##', '#', '')
endif endif
let l:detail = l:message
if get(l:object, 'description', 'None') isnot# 'None'
let l:detail .= "\n\n" . l:object['description']
endif
let l:detail .= "\n\n" . l:link
call add(l:messages, { call add(l:messages, {
\ 'lnum': l:line, \ 'lnum': l:line,
\ 'text': l:message, \ 'text': l:message,
\ 'type': ale_linters#dockerfile#dockerfile_lint#GetType(l:type), \ 'type': ale_linters#dockerfile#dockerfile_lint#GetType(l:type),
\ 'detail': l:detail,
\}) \})
endfor endfor
endfor endfor

View File

@ -0,0 +1,21 @@
" Author: Penghui Liao <liaoishere@gmail.com>
" Description: Adds support for revive
call ale#Set('go_revive_executable', 'revive')
call ale#Set('go_revive_options', '')
function! ale_linters#go#revive#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'go_revive_options')
return ale#go#EnvString(a:buffer) . '%e'
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' %t'
endfunction
call ale#linter#Define('go', {
\ 'name': 'revive',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#Var(b, 'go_revive_executable')},
\ 'command': function('ale_linters#go#revive#GetCommand'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
\})

View File

@ -7,6 +7,7 @@ call ale#Set('java_eclipselsp_path', ale#path#Simplify($HOME . '/eclipse.jdt.ls'
call ale#Set('java_eclipselsp_config_path', '') call ale#Set('java_eclipselsp_config_path', '')
call ale#Set('java_eclipselsp_workspace_path', '') call ale#Set('java_eclipselsp_workspace_path', '')
call ale#Set('java_eclipselsp_executable', 'java') call ale#Set('java_eclipselsp_executable', 'java')
call ale#Set('java_eclipselsp_javaagent', '')
function! ale_linters#java#eclipselsp#Executable(buffer) abort function! ale_linters#java#eclipselsp#Executable(buffer) abort
return ale#Var(a:buffer, 'java_eclipselsp_executable') return ale#Var(a:buffer, 'java_eclipselsp_executable')
@ -100,12 +101,30 @@ function! ale_linters#java#eclipselsp#WorkspacePath(buffer) abort
return ale#path#Dirname(ale#java#FindProjectRoot(a:buffer)) return ale#path#Dirname(ale#java#FindProjectRoot(a:buffer))
endfunction endfunction
function! ale_linters#java#eclipselsp#Javaagent(buffer) abort
let l:rets = []
let l:raw = ale#Var(a:buffer, 'java_eclipselsp_javaagent')
if empty(l:raw)
return ''
endif
let l:jars = split(l:raw)
for l:jar in l:jars
call add(l:rets, ale#Escape('-javaagent:' . l:jar))
endfor
return join(l:rets, ' ')
endfunction
function! ale_linters#java#eclipselsp#Command(buffer, version) abort function! ale_linters#java#eclipselsp#Command(buffer, version) abort
let l:path = ale#Var(a:buffer, 'java_eclipselsp_path') let l:path = ale#Var(a:buffer, 'java_eclipselsp_path')
let l:executable = ale_linters#java#eclipselsp#Executable(a:buffer) let l:executable = ale_linters#java#eclipselsp#Executable(a:buffer)
let l:cmd = [ ale#Escape(l:executable), let l:cmd = [ ale#Escape(l:executable),
\ ale_linters#java#eclipselsp#Javaagent(a:buffer),
\ '-Declipse.application=org.eclipse.jdt.ls.core.id1', \ '-Declipse.application=org.eclipse.jdt.ls.core.id1',
\ '-Dosgi.bundles.defaultStartLevel=4', \ '-Dosgi.bundles.defaultStartLevel=4',
\ '-Declipse.product=org.eclipse.jdt.ls.core.product', \ '-Declipse.product=org.eclipse.jdt.ls.core.product',

View File

@ -6,6 +6,7 @@ let s:classpath_sep = has('unix') ? ':' : ';'
call ale#Set('java_javac_executable', 'javac') call ale#Set('java_javac_executable', 'javac')
call ale#Set('java_javac_options', '') call ale#Set('java_javac_options', '')
call ale#Set('java_javac_classpath', '') call ale#Set('java_javac_classpath', '')
call ale#Set('java_javac_sourcepath', '')
function! ale_linters#java#javac#RunWithImportPaths(buffer) abort function! ale_linters#java#javac#RunWithImportPaths(buffer) abort
let l:command = '' let l:command = ''
@ -40,10 +41,15 @@ endfunction
function! s:BuildClassPathOption(buffer, import_paths) abort function! s:BuildClassPathOption(buffer, import_paths) abort
" Filter out lines like [INFO], etc. " Filter out lines like [INFO], etc.
let l:class_paths = filter(a:import_paths[:], 'v:val !~# ''[''') let l:class_paths = filter(a:import_paths[:], 'v:val !~# ''[''')
call extend( let l:cls_path = ale#Var(a:buffer, 'java_javac_classpath')
\ l:class_paths,
\ split(ale#Var(a:buffer, 'java_javac_classpath'), s:classpath_sep), if !empty(l:cls_path) && type(l:cls_path) is v:t_string
\) call extend(l:class_paths, split(l:cls_path, s:classpath_sep))
endif
if !empty(l:cls_path) && type(l:cls_path) is v:t_list
call extend(l:class_paths, l:cls_path)
endif
return !empty(l:class_paths) return !empty(l:class_paths)
\ ? '-cp ' . ale#Escape(join(l:class_paths, s:classpath_sep)) \ ? '-cp ' . ale#Escape(join(l:class_paths, s:classpath_sep))
@ -79,6 +85,27 @@ function! ale_linters#java#javac#GetCommand(buffer, import_paths, meta) abort
endif endif
endif endif
let l:source_paths = []
let l:source_path = ale#Var(a:buffer, 'java_javac_sourcepath')
if !empty(l:source_path) && type(l:source_path) is v:t_string
let l:source_paths = split(l:source_path, s:classpath_sep)
endif
if !empty(l:source_path) && type(l:source_path) is v:t_list
let l:source_paths = l:source_path
endif
if !empty(l:source_paths)
for l:path in l:source_paths
let l:sp_path = ale#path#FindNearestDirectory(a:buffer, l:path)
if !empty(l:sp_path)
call add(l:sp_dirs, l:sp_path)
endif
endfor
endif
if !empty(l:sp_dirs) if !empty(l:sp_dirs)
let l:sp_option = '-sourcepath ' let l:sp_option = '-sourcepath '
\ . ale#Escape(join(l:sp_dirs, s:classpath_sep)) \ . ale#Escape(join(l:sp_dirs, s:classpath_sep))

View File

@ -163,7 +163,7 @@ function! ale#Queue(delay, ...) abort
endif endif
endfunction endfunction
let s:current_ale_version = [2, 6, 0] let s:current_ale_version = [2, 7, 0]
" A function used to check for ALE features in files outside of the project. " A function used to check for ALE features in files outside of the project.
function! ale#Has(feature) abort function! ale#Has(feature) abort

View File

@ -7,8 +7,40 @@ cfn-python-lint *ale-cloudformation-cfn-python-lint*
cfn-python-lint is a linter for AWS CloudFormation template file. cfn-python-lint is a linter for AWS CloudFormation template file.
https://github.com/awslabs/cfn-python-lint Website: https://github.com/awslabs/cfn-python-lint
Installation
-------------------------------------------------------------------------------
Install cfn-python-lint using either pip or brew: >
`pip install cfn-lint`. If pip is not available, run
`python setup.py clean --all` then `python setup.py install`.
Homebrew (macOS):
`brew install cfn-lint`
<
Configuration
-------------------------------------------------------------------------------
To get cloudformation linter to work on only CloudFormation files we must set
the buffer |filetype| to yaml.cloudformation.
This causes ALE to lint the file with linters configured for cloudformation and
yaml files.
Just put:
>
au BufRead,BufNewFile *.template.yaml set filetype=yaml.cloudformation
<
on `ftdetect/cloudformation.vim`
This will get both cloudformation and yaml linters to work on any file with `.template.yaml` ext.
=============================================================================== ===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@ -219,6 +219,25 @@ g:ale_go_govet_options *g:ale_go_govet_options*
This variable can be set to pass additional options to the go vet linter. This variable can be set to pass additional options to the go vet linter.
===============================================================================
revive *ale-go-revive*
g:ale_go_revive_executable *g:ale_go_revive_executable*
*b:ale_go_revive_executable*
Type: |String|
Default: `'revive'`
This variable can be set to change the revive executable path.
g:ale_go_revive_options *g:ale_go_revive_options*
*b:ale_go_revive_options*
Type: |String|
Default: `''`
This variable can be set to pass additional options to the revive
=============================================================================== ===============================================================================
staticcheck *ale-go-staticcheck* staticcheck *ale-go-staticcheck*

View File

@ -46,7 +46,7 @@ javac *ale-java-javac*
g:ale_java_javac_classpath *g:ale_java_javac_classpath* g:ale_java_javac_classpath *g:ale_java_javac_classpath*
*b:ale_java_javac_classpath* *b:ale_java_javac_classpath*
Type: |String| Type: |String| or |List|
Default: `''` Default: `''`
This variable can be set to change the global classpath for Java. This variable can be set to change the global classpath for Java.
@ -67,6 +67,30 @@ g:ale_java_javac_options *g:ale_java_javac_options*
This variable can be set to pass additional options to javac. This variable can be set to pass additional options to javac.
g:ale_java_javac_sourcepath *g:ale_java_javac_sourcepath*
*b:ale_java_javac_sourcepath*
Type: |String| or |List|
Default: `''`
This variable can set multiple source code paths, the source code path is a
relative path (relative to the project root directory).
Example:
String type:
Note that the unix system separator is a colon(`:`) window system
is a semicolon(`;`).
>
let g:ale_java_javac_sourcepath = 'build/gen/source/xx/main:build/gen/source'
<
List type:
>
let g:ale_java_javac_sourcepath = [
\ 'build/generated/source/querydsl/main',
\ 'target/generated-sources/source/querydsl/main'
\ ]
<
=============================================================================== ===============================================================================
google-java-format *ale-java-google-java-format* google-java-format *ale-java-google-java-format*
@ -222,6 +246,17 @@ g:ale_java_eclipselsp_workspace_path *g:ale_java_eclipselsp_workspace_path*
absolute path of the Eclipse workspace. If not set this value will be set to absolute path of the Eclipse workspace. If not set this value will be set to
the parent folder of the project root. the parent folder of the project root.
g:ale_java_eclipselsp_javaagent *g:ale_java_eclipselsp_javaagent*
*b:ale_java_eclipselsp_javaagent*
Type: |String|
Default: `''`
A variable to add java agent for annotation processing such as Lombok.
If you have multiple java agent files, use space to separate them. For example:
>
let g:ale_java_eclipselsp_javaagent='/eclipse/lombok.jar /eclipse/jacoco.jar'
<
=============================================================================== ===============================================================================
uncrustify *ale-java-uncrustify* uncrustify *ale-java-uncrustify*

View File

@ -164,6 +164,7 @@ Notes:
* `gosimple`!! * `gosimple`!!
* `gotype`!! * `gotype`!!
* `go vet`!! * `go vet`!!
* `revive`!!
* `staticcheck`!! * `staticcheck`!!
* GraphQL * GraphQL
* `eslint` * `eslint`

View File

@ -2379,6 +2379,7 @@ documented in additional help files.
gometalinter..........................|ale-go-gometalinter| gometalinter..........................|ale-go-gometalinter|
gopls.................................|ale-go-gopls| gopls.................................|ale-go-gopls|
govet.................................|ale-go-govet| govet.................................|ale-go-govet|
revive................................|ale-go-revive|
staticcheck...........................|ale-go-staticcheck| staticcheck...........................|ale-go-staticcheck|
graphql.................................|ale-graphql-options| graphql.................................|ale-graphql-options|
eslint................................|ale-graphql-eslint| eslint................................|ale-graphql-eslint|

View File

@ -173,6 +173,7 @@ formatting.
* [gosimple](https://github.com/dominikh/go-tools/tree/master/cmd/gosimple) :warning: :floppy_disk: * [gosimple](https://github.com/dominikh/go-tools/tree/master/cmd/gosimple) :warning: :floppy_disk:
* [gotype](https://godoc.org/golang.org/x/tools/cmd/gotype) :warning: :floppy_disk: * [gotype](https://godoc.org/golang.org/x/tools/cmd/gotype) :warning: :floppy_disk:
* [go vet](https://golang.org/cmd/vet/) :floppy_disk: * [go vet](https://golang.org/cmd/vet/) :floppy_disk:
* [revive](https://github.com/mgechev/revive) :warning: :floppy_disk:
* [staticcheck](https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck) :warning: :floppy_disk: * [staticcheck](https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck) :warning: :floppy_disk:
* GraphQL * GraphQL
* [eslint](http://eslint.org/) * [eslint](http://eslint.org/)

View File

@ -790,6 +790,9 @@ fu! s:BuildPrompt(upd)
if empty(prt[1]) && s:focus if empty(prt[1]) && s:focus
exe 'echoh' hibase '| echon "_" | echoh None' exe 'echoh' hibase '| echon "_" | echoh None'
en en
if a:upd
cal s:NotifySearch()
en
endf endf
" - SetDefTxt() {{{1 " - SetDefTxt() {{{1
fu! s:SetDefTxt() fu! s:SetDefTxt()
@ -2609,6 +2612,10 @@ fu! ctrlp#clearmarkedlist()
let s:marked = {} let s:marked = {}
endf endf
fu! ctrlp#input()
retu s:getinput()
endf
fu! ctrlp#exit() fu! ctrlp#exit()
cal s:PrtExit() cal s:PrtExit()
endf endf
@ -2735,8 +2742,21 @@ fu! ctrlp#init(type, ...)
en en
cal s:BuildPrompt(1) cal s:BuildPrompt(1)
if s:keyloop | cal s:KeyLoop() | en if s:keyloop | cal s:KeyLoop() | en
return 1 retu 1
endf endf
" - Events {{{1
fu! s:NotifySearch()
let l:cb = s:getextvar('search')
if l:cb != -1
cal eval(l:cb)
en
endf
fu! ctrlp#update()
cal s:ForceUpdate()
endf
" - Autocmds {{{1 " - Autocmds {{{1
if has('autocmd') if has('autocmd')
aug CtrlPAug aug CtrlPAug

View File

@ -203,7 +203,7 @@ function! s:goyo_on(dim)
endif endif
" vim-signify " vim-signify
let t:goyo_disabled_signify = exists('b:sy') && b:sy.active let t:goyo_disabled_signify = !empty(getbufvar(bufnr(''), 'sy'))
if t:goyo_disabled_signify if t:goyo_disabled_signify
SignifyToggle SignifyToggle
endif endif

View File

@ -13,6 +13,7 @@ jobs:
strategy: strategy:
matrix: matrix:
vim: vim:
- v8.2.1000
- v8.2.0000 - v8.2.0000
- v8.1.0000 - v8.1.0000
- v8.0.0000 - v8.0.0000

View File

@ -2,7 +2,7 @@
" Filename: autoload/lightline.vim " Filename: autoload/lightline.vim
" Author: itchyny " Author: itchyny
" License: MIT License " License: MIT License
" Last Change: 2020/03/16 19:10:15. " Last Change: 2020/06/19 11:08:46.
" ============================================================================= " =============================================================================
let s:save_cpo = &cpo let s:save_cpo = &cpo
@ -11,27 +11,35 @@ set cpo&vim
let s:_ = 1 " 1: uninitialized, 2: disabled let s:_ = 1 " 1: uninitialized, 2: disabled
function! lightline#update() abort function! lightline#update() abort
if &buftype ==# 'popup' | return | endif if s:skip() | return | endif
if s:_ if s:_
if s:_ == 2 | return | endif if s:_ == 2 | return | endif
call lightline#init() call lightline#init()
call lightline#colorscheme() call lightline#colorscheme()
endif endif
if !s:lightline.enable.statusline if s:lightline.enable.statusline
return let w = winnr()
let s = winnr('$') == 1 && w > 0 ? [lightline#statusline(0)] : [lightline#statusline(0), lightline#statusline(1)]
for n in range(1, winnr('$'))
call setwinvar(n, '&statusline', s[n!=w])
endfor
endif endif
let w = winnr()
let s = winnr('$') == 1 && w > 0 ? [lightline#statusline(0)] : [lightline#statusline(0), lightline#statusline(1)]
for n in range(1, winnr('$'))
call setwinvar(n, '&statusline', s[n!=w])
endfor
endfunction endfunction
if exists('*win_gettype')
function! s:skip() abort " Vim 8.2.0257 (00f3b4e007), 8.2.0991 (0fe937fd86), 8.2.0996 (40a019f157)
return win_gettype() ==# 'popup' || win_gettype() ==# 'autocmd'
endfunction
else
function! s:skip() abort
return &buftype ==# 'popup'
endfunction
endif
function! lightline#update_disable() abort function! lightline#update_disable() abort
if !s:lightline.enable.statusline if s:lightline.enable.statusline
return call setwinvar(0, '&statusline', '')
endif endif
call setwinvar(0, '&statusline', '')
endfunction endfunction
function! lightline#enable() abort function! lightline#enable() abort
@ -190,13 +198,7 @@ function! lightline#colorscheme() abort
let s:lightline.palette = g:lightline#colorscheme#{s:lightline.colorscheme}#palette let s:lightline.palette = g:lightline#colorscheme#{s:lightline.colorscheme}#palette
finally finally
if has('win32') && !has('gui_running') && &t_Co < 256 if has('win32') && !has('gui_running') && &t_Co < 256
for u in values(s:lightline.palette) call lightline#colortable#gui2cui_palette(s:lightline.palette)
for v in values(u)
for _ in v
let [_[2], _[3]] = [lightline#colortable#gui2cui(_[0], _[2]), lightline#colortable#gui2cui(_[1], _[3])]
endfor
endfor
endfor
endif endif
let s:highlight = {} let s:highlight = {}
call lightline#highlight('normal') call lightline#highlight('normal')

View File

@ -5,7 +5,7 @@
" Last Change: 2013/09/07 12:21:04. " Last Change: 2013/09/07 12:21:04.
" ============================================================================= " =============================================================================
let s:base03 = [ '#151513', 233 ] let s:base03 = [ '#151513', 233 ]
let s:base02 = [ '#30302c ', 236 ] let s:base02 = [ '#30302c', 236 ]
let s:base01 = [ '#4e4e43', 239 ] let s:base01 = [ '#4e4e43', 239 ]
let s:base00 = [ '#666656', 242 ] let s:base00 = [ '#666656', 242 ]
let s:base0 = [ '#808070', 244 ] let s:base0 = [ '#808070', 244 ]

View File

@ -5,7 +5,7 @@
" Last Change: 2015/11/02 08:23:27. " Last Change: 2015/11/02 08:23:27.
" ============================================================================= " =============================================================================
let s:base03 = [ '#151513', 233 ] let s:base03 = [ '#151513', 233 ]
let s:base02 = [ '#30302c ', 236 ] let s:base02 = [ '#30302c', 236 ]
let s:base01 = [ '#4e4e43', 239 ] let s:base01 = [ '#4e4e43', 239 ]
let s:base00 = [ '#666656', 242 ] let s:base00 = [ '#666656', 242 ]
let s:base0 = [ '#808070', 244 ] let s:base0 = [ '#808070', 244 ]

View File

@ -5,7 +5,7 @@
" Last Change: 2018/05/19 " Last Change: 2018/05/19
" ============================================================================= " =============================================================================
let s:base03 = [ '#151513', 233 ] let s:base03 = [ '#151513', 233 ]
let s:base02 = [ '#30302c ', 236 ] let s:base02 = [ '#30302c', 236 ]
let s:base01 = [ '#4e4e43', 239 ] let s:base01 = [ '#4e4e43', 239 ]
let s:base00 = [ '#666656', 242 ] let s:base00 = [ '#666656', 242 ]
let s:base0 = [ '#808070', 244 ] let s:base0 = [ '#808070', 244 ]

View File

@ -5,8 +5,8 @@
" Last Change: 2015/11/30 08:37:43. " Last Change: 2015/11/30 08:37:43.
" ============================================================================= " =============================================================================
let s:base03 = [ '#242424', 235 ] let s:base03 = [ '#242424', 235 ]
let s:base023 = [ '#353535 ', 236 ] let s:base023 = [ '#353535', 236 ]
let s:base02 = [ '#444444 ', 238 ] let s:base02 = [ '#444444', 238 ]
let s:base01 = [ '#585858', 240 ] let s:base01 = [ '#585858', 240 ]
let s:base00 = [ '#666666', 242 ] let s:base00 = [ '#666666', 242 ]
let s:base0 = [ '#808080', 244 ] let s:base0 = [ '#808080', 244 ]

View File

@ -2,7 +2,7 @@
" Filename: autoload/lightline/colortable.vim " Filename: autoload/lightline/colortable.vim
" Author: itchyny " Author: itchyny
" License: MIT License " License: MIT License
" Last Change: 2015/03/29 06:21:39. " Last Change: 2020/06/19 11:07:13.
" ============================================================================= " =============================================================================
let s:save_cpo = &cpo let s:save_cpo = &cpo
@ -38,5 +38,15 @@ function! lightline#colortable#gui2cui(rgb, fallback) abort
return rgb[0] + rgb[1] + rgb[2] return rgb[0] + rgb[1] + rgb[2]
endfunction endfunction
function! lightline#colortable#gui2cui_palette(palette) abort
for u in values(a:palette)
for v in values(u)
for w in v
let [w[2], w[3]] = [lightline#colortable#gui2cui(w[0], w[2]), lightline#colortable#gui2cui(w[1], w[3])]
endfor
endfor
endfor
endfunction
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo

View File

@ -0,0 +1,23 @@
if !has("patch-8.2.0996")
finish
endif
let s:suite = themis#suite('autocmd')
let s:assert = themis#helper('assert')
function! s:suite.before_each()
let g:lightline = {}
call lightline#init()
tabnew
tabonly
endfunction
function! s:suite.doautoall()
tabnew
tabnew
tabprevious
doautoall WinEnter
let statusline = getwinvar(1, '&statusline')
call s:assert.match(statusline, 'lightline')
call s:assert.match(statusline, '_active_')
endfunction

View File

@ -4,7 +4,14 @@
version in an unordered list. The format is: version in an unordered list. The format is:
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR) - **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
--> -->
#### 6.8
- **.0**: Allow concealed characters to show another character. (PhilRunninger) [#1138](https://github.com/preservim/nerdtree/pull/1138)
#### 6.7 #### 6.7
- **.15**: Add curly braces to the list of characters to be escaped. (PhilRunninger) [#1128](https://github.com/preservim/nerdtree/pull/1128)
- **.14**: Use backward-compatible `nerdtree#and()` in one place that was missed. (PhilRunninger) [#1134](https://github.com/preservim/nerdtree/pull/1134)
- **.13**: `cmd.exe /c start "" <filename>` for windows default viewer support. (J. Altayó) [#1130](https://github.com/preservim/nerdtree/pull/1130)
- **.12**: Fixed a bug that caused the file-tree construction to slow down significantly. (Eugenij-W) [#1126](https://github.com/preservim/nerdtree/pull/1126)
- **.11**: Fix exception in NERDTreeFind (on windows OS and If the file is located in the root directory of the disk) (Eugenij-W) [#1122](https://github.com/preservim/nerdtree/pull/1122)
- **.10**: Do not consider the tree root to be "cascadable". (lifecrisis) [#1120](https://github.com/preservim/nerdtree/pull/1120) - **.10**: Do not consider the tree root to be "cascadable". (lifecrisis) [#1120](https://github.com/preservim/nerdtree/pull/1120)
- **.9**: Force `:NERDTreeFocus` to allow events to be fired when switching windows. (PhilRunninger) [#1118](https://github.com/preservim/nerdtree/pull/1118) - **.9**: Force `:NERDTreeFocus` to allow events to be fired when switching windows. (PhilRunninger) [#1118](https://github.com/preservim/nerdtree/pull/1118)
- **.8**: Fix example code for the `NERDTreeAddKeyMap()` function. (PhilRunninger) [#1116](https://github.com/preservim/nerdtree/pull/1116) - **.8**: Fix example code for the `NERDTreeAddKeyMap()` function. (PhilRunninger) [#1116](https://github.com/preservim/nerdtree/pull/1116)

View File

@ -45,7 +45,7 @@ function! nerdtree#slash() abort
endfunction endfunction
"FUNCTION: nerdtree#and(x,y) {{{2 "FUNCTION: nerdtree#and(x,y) {{{2
" Implements and() function for Vim <= 7.2 " Implements and() function for Vim <= 7.4
function! nerdtree#and(x,y) abort function! nerdtree#and(x,y) abort
if exists('*and') if exists('*and')
return and(a:x, a:y) return and(a:x, a:y)

View File

@ -249,7 +249,11 @@ function! s:Creator._pathForString(str)
if dir =~# '^\.' if dir =~# '^\.'
let dir = getcwd() . g:NERDTreePath.Slash() . dir let dir = getcwd() . g:NERDTreePath.Slash() . dir
endif endif
let dir = g:NERDTreePath.Resolve(dir)
"hack to prevent removing slash if dir is the root of the file system.
if dir !=# '/'
let dir = g:NERDTreePath.Resolve(dir)
endif
try try
let path = g:NERDTreePath.New(dir) let path = g:NERDTreePath.New(dir)

View File

@ -219,7 +219,7 @@ endfunction
" FUNCTION: Opener._openFile() {{{1 " FUNCTION: Opener._openFile() {{{1
function! s:Opener._openFile() function! s:Opener._openFile()
if !self._stay && !and(g:NERDTreeQuitOnOpen,1) && exists('b:NERDTreeZoomed') && b:NERDTreeZoomed if !self._stay && !nerdtree#and(g:NERDTreeQuitOnOpen,1) && exists('b:NERDTreeZoomed') && b:NERDTreeZoomed
call b:NERDTree.ui.toggleZoom() call b:NERDTree.ui.toggleZoom()
endif endif

View File

@ -332,7 +332,7 @@ function! s:Path._escChars()
return " `\|\"#%&,?()\*^<>$" return " `\|\"#%&,?()\*^<>$"
endif endif
return " \\`\|\"#%&,?()\*^<>[]$" return " \\`\|\"#%&,?()\*^<>[]{}$"
endfunction endfunction
" FUNCTION: Path.getDir() {{{1 " FUNCTION: Path.getDir() {{{1
@ -546,26 +546,36 @@ endfunction
" return 1 if this path is somewhere above the given path in the filesystem. " return 1 if this path is somewhere above the given path in the filesystem.
" "
" a:path should be a dir " a:path should be a dir
function! s:Path.isAncestor(path) function! s:Path.isAncestor(child)
if !self.isDirectory return a:child.isUnder(self)
return 0
endif
let this = self.str()
let that = a:path.str()
return stridx(that, this) ==# 0
endfunction endfunction
" FUNCTION: Path.isUnder(path) {{{1 " FUNCTION: Path.isUnder(path) {{{1
" return 1 if this path is somewhere under the given path in the filesystem. " return 1 if this path is somewhere under the given path in the filesystem.
function! s:Path.isUnder(path) function! s:Path.isUnder(parent)
if a:path.isDirectory ==# 0 if a:parent.isDirectory ==# 0
return 0 return 0
endif endif
if nerdtree#runningWindows() && a:parent.drive !=# self.drive
let this = self.str() return 0
let that = a:path.str() endif
return stridx(this, that . s:Path.Slash()) ==# 0 let l:this_count = len(self.pathSegments)
if l:this_count ==# 0
return 0
endif
let l:that_count = len(a:parent.pathSegments)
if l:that_count ==# 0
return 1
endif
if l:that_count >= l:this_count
return 0
endif
for i in range(0, l:that_count-1)
if self.pathSegments[i] !=# a:parent.pathSegments[i]
return 0
endif
endfor
return 1
endfunction endfunction
" FUNCTION: Path.JoinPathStrings(...) {{{1 " FUNCTION: Path.JoinPathStrings(...) {{{1

View File

@ -431,6 +431,7 @@ function! s:TreeDirNode._initChildren(silent)
endtry endtry
endfor endfor
let g:NERDTreeOldSortOrder = g:NERDTreeSortOrder
call self.sortChildren() call self.sortChildren()
call nerdtree#echo('') call nerdtree#echo('')

View File

@ -34,6 +34,10 @@ if executable('xdg-open')
call NERDTreeAddMenuItem({'text': '(o)pen the current node with system editor', 'shortcut': 'o', 'callback': 'NERDTreeExecuteFileLinux'}) call NERDTreeAddMenuItem({'text': '(o)pen the current node with system editor', 'shortcut': 'o', 'callback': 'NERDTreeExecuteFileLinux'})
endif endif
if nerdtree#runningWindows()
call NERDTreeAddMenuItem({'text': '(o)pen the current node with system editor', 'shortcut': 'o', 'callback': 'NERDTreeExecuteFileWindows'})
endif
if g:NERDTreePath.CopyingSupported() if g:NERDTreePath.CopyingSupported()
call NERDTreeAddMenuItem({'text': '(c)opy the current node', 'shortcut': 'c', 'callback': 'NERDTreeCopyNode'}) call NERDTreeAddMenuItem({'text': '(c)opy the current node', 'shortcut': 'c', 'callback': 'NERDTreeCopyNode'})
endif endif
@ -451,4 +455,15 @@ function! NERDTreeExecuteFileLinux()
call system('xdg-open ' . shellescape(l:node.path.str())) call system('xdg-open ' . shellescape(l:node.path.str()))
endfunction endfunction
" FUNCTION: NERDTreeExecuteFileWindows() {{{1
function! NERDTreeExecuteFileWindows()
let l:node = g:NERDTreeFileNode.GetSelected()
if empty(l:node)
return
endif
call system('cmd.exe /c start "" ' . shellescape(l:node.path.str()))
endfunction
" vim: set sw=4 sts=4 et fdm=marker: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -22,7 +22,7 @@ syn match NERDTreeLinkDir #.*/ ->#me=e-3 containedin=NERDTreeDir
"highlighting to conceal the delimiter around the file/dir name "highlighting to conceal the delimiter around the file/dir name
if has('conceal') if has('conceal')
exec 'syn match NERDTreeNodeDelimiters #\%d' . char2nr(g:NERDTreeNodeDelimiter) . '# conceal containedin=ALL' exec 'syn match NERDTreeNodeDelimiters #\%d' . char2nr(g:NERDTreeNodeDelimiter) . '# conceal containedin=ALL'
setlocal conceallevel=3 concealcursor=nvic setlocal conceallevel=2 concealcursor=nvic
else else
exec 'syn match NERDTreeNodeDelimiters #\%d' . char2nr(g:NERDTreeNodeDelimiter) . '# containedin=ALL' exec 'syn match NERDTreeNodeDelimiters #\%d' . char2nr(g:NERDTreeNodeDelimiter) . '# containedin=ALL'
hi! link NERDTreeNodeDelimiters Ignore hi! link NERDTreeNodeDelimiters Ignore

View File

@ -298,12 +298,15 @@ syn keyword ngxDirective large_client_header_buffers
syn keyword ngxDirective least_conn syn keyword ngxDirective least_conn
syn keyword ngxDirective least_time syn keyword ngxDirective least_time
syn keyword ngxDirective limit_conn syn keyword ngxDirective limit_conn
syn keyword ngxDirective limit_conn_dry_run
syn keyword ngxDirective limit_conn_log_level syn keyword ngxDirective limit_conn_log_level
syn keyword ngxDirective limit_conn_status syn keyword ngxDirective limit_conn_status
syn keyword ngxDirective limit_conn_zone syn keyword ngxDirective limit_conn_zone
syn keyword ngxDirective limit_except
syn keyword ngxDirective limit_rate syn keyword ngxDirective limit_rate
syn keyword ngxDirective limit_rate_after syn keyword ngxDirective limit_rate_after
syn keyword ngxDirective limit_req syn keyword ngxDirective limit_req
syn keyword ngxDirective limit_req_dry_run
syn keyword ngxDirective limit_req_log_level syn keyword ngxDirective limit_req_log_level
syn keyword ngxDirective limit_req_status syn keyword ngxDirective limit_req_status
syn keyword ngxDirective limit_req_zone syn keyword ngxDirective limit_req_zone

View File

@ -67,8 +67,7 @@ syn keyword rustObsoleteExternMod mod contained nextgroup=rustIdentifier skipw
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
syn region rustMacroRepeat matchgroup=rustMacroRepeatDelimiters start="$(" end=")" contains=TOP nextgroup=rustMacroRepeatCount syn region rustMacroRepeat matchgroup=rustMacroRepeatDelimiters start="$(" end="),\=[*+]" contains=TOP
syn match rustMacroRepeatCount ".\?[*+]" contained
syn match rustMacroVariable "$\w\+" syn match rustMacroVariable "$\w\+"
" Reserved (but not yet used) keywords {{{2 " Reserved (but not yet used) keywords {{{2
@ -231,6 +230,27 @@ syn region rustCommentBlockDocNestError matchgroup=rustCommentBlockDocError star
syn keyword rustTodo contained TODO FIXME XXX NB NOTE syn keyword rustTodo contained TODO FIXME XXX NB NOTE
" asm! macro {{{2
syn region rustAsmMacro matchgroup=rustMacro start="\<asm!\s*(" end=")" contains=rustAsmDirSpec,rustAsmSym,rustAsmConst,rustAsmOptionsGroup,rustComment.*,rustString.*
" Clobbered registers
syn keyword rustAsmDirSpec in out lateout inout inlateout contained nextgroup=rustAsmReg skipwhite skipempty
syn region rustAsmReg start="(" end=")" contained contains=rustString
" Symbol operands
syn keyword rustAsmSym sym contained nextgroup=rustAsmSymPath skipwhite skipempty
syn region rustAsmSymPath start="\S" end=",\|)"me=s-1 contained contains=rustComment.*,rustIdentifier
" Const
syn region rustAsmConstBalancedParens start="("ms=s+1 end=")" contained contains=@rustAsmConstExpr
syn cluster rustAsmConstExpr contains=rustComment.*,rust.*Number,rustString,rustAsmConstBalancedParens
syn region rustAsmConst start="const" end=",\|)"me=s-1 contained contains=rustStorage,@rustAsmConstExpr
" Options
syn region rustAsmOptionsGroup start="options\s*(" end=")" contained contains=rustAsmOptions,rustAsmOptionsKey
syn keyword rustAsmOptionsKey options contained
syn keyword rustAsmOptions pure nomem readonly preserves_flags noreturn nostack att_syntax contained
" Folding rules {{{2 " Folding rules {{{2
" Trivial folding rules to begin with. " Trivial folding rules to begin with.
" FIXME: use the AST to make really good folding " FIXME: use the AST to make really good folding
@ -278,7 +298,6 @@ hi def link rustIdentifierPrime rustIdentifier
hi def link rustTrait rustType hi def link rustTrait rustType
hi def link rustDeriveTrait rustTrait hi def link rustDeriveTrait rustTrait
hi def link rustMacroRepeatCount rustMacroRepeatDelimiters
hi def link rustMacroRepeatDelimiters Macro hi def link rustMacroRepeatDelimiters Macro
hi def link rustMacroVariable Define hi def link rustMacroVariable Define
hi def link rustSigil StorageClass hi def link rustSigil StorageClass
@ -347,6 +366,10 @@ hi def link rustObsoleteExternMod Error
hi def link rustQuestionMark Special hi def link rustQuestionMark Special
hi def link rustAsync rustKeyword hi def link rustAsync rustKeyword
hi def link rustAwait rustKeyword hi def link rustAwait rustKeyword
hi def link rustAsmDirSpec rustKeyword
hi def link rustAsmSym rustKeyword
hi def link rustAsmOptions rustKeyword
hi def link rustAsmOptionsKey rustAttribute
" Other Suggestions: " Other Suggestions:
" hi rustAttribute ctermfg=cyan " hi rustAttribute ctermfg=cyan

View File

@ -2272,10 +2272,33 @@ augroup END
" Section: :Git " Section: :Git
function! s:AskPassArgs(dir) abort
if (len($DISPLAY) || len($TERM_PROGRAM) || has('gui_running')) && fugitive#GitVersion(1, 8) &&
\ empty($GIT_ASKPASS) && empty($SSH_ASKPASS) && empty(FugitiveConfigGetAll('core.askpass', a:dir))
if s:executable(s:ExecPath() . '/git-gui--askpass')
return ['-c', 'core.askPass=' . s:ExecPath() . '/git-gui--askpass']
elseif s:executable('ssh-askpass')
return ['-c', 'core.askPass=ssh-askpass']
endif
endif
return []
endfunction
function! s:RunJobs() abort function! s:RunJobs() abort
return exists('*job_start') || exists('*jobstart') return exists('*job_start') || exists('*jobstart')
endfunction endfunction
function! s:RunEdit(state, job) abort
if get(a:state, 'request', '') == 'edit'
call remove(a:state, 'request')
let file = readfile(a:state.temp . '.edit')[0]
exe substitute(a:state.mods, '\<tab\>', '-tab', 'g') 'keepalt split' s:fnameescape(file)
set bufhidden=wipe
let s:edit_jobs[bufnr('')] = [a:state, a:job]
return 1
endif
endfunction
function! s:RunReceive(state, job, data, ...) abort function! s:RunReceive(state, job, data, ...) abort
call add(a:state.log, a:data) call add(a:state.log, a:data)
let data = type(a:data) == type([]) ? join(a:data, "\n") : a:data let data = type(a:data) == type([]) ? join(a:data, "\n") : a:data
@ -2283,16 +2306,21 @@ function! s:RunReceive(state, job, data, ...) abort
let data = remove(a:state, 'buffer') . data let data = remove(a:state, 'buffer') . data
endif endif
let escape = "\033]51;[^\007]*" let escape = "\033]51;[^\007]*"
let a:state.buffer = matchstr(data, escape . "$\\|[\r\n]\\+$") let a:state.escape_buffer = matchstr(data, escape . '$')
if len(a:state.buffer) if len(a:state.escape_buffer)
let data = strpart(data, 0, len(data) - len(a:state.buffer)) let data = strpart(data, 0, len(data) - len(a:state.escape_buffer))
endif endif
let cmd = matchstr(data, escape . "\007")[5:-2] let cmd = matchstr(data, escape . "\007")[5:-2]
let data = substitute(data, escape . "\007", '', 'g') let data = substitute(data, escape . "\007", '', 'g')
echon substitute(data, "\r\\ze\n", '', 'g')
if cmd =~# '^fugitive:' if cmd =~# '^fugitive:'
let a:state.request = strpart(cmd, 9) let a:state.request = strpart(cmd, 9)
endif endif
let data = a:state.echo_buffer . data
let a:state.echo_buffer = matchstr(data, "[\r\n]\\+$")
if len(a:state.echo_buffer)
let data = strpart(data, 0, len(data) - len(a:state.echo_buffer))
endif
echon substitute(data, "\r\\ze\n", '', 'g')
endfunction endfunction
function! s:RunSend(job, str) abort function! s:RunSend(job, str) abort
@ -2314,7 +2342,7 @@ endif
function! s:RunWait(state, job) abort function! s:RunWait(state, job) abort
let finished = 0 let finished = 0
try try
while get(a:state, 'request', '') !=# 'edit' && (type(a:job) == type(0) ? jobwait([a:job], 1)[0] == -1 : ch_status(a:job) !=# 'closed') while get(a:state, 'request', '') !=# 'edit' && (type(a:job) == type(0) ? jobwait([a:job], 1)[0] == -1 : ch_status(a:job) !=# 'closed' || job_status(a:job) ==# 'run')
if !exists('*jobwait') if !exists('*jobwait')
sleep 1m sleep 1m
endif endif
@ -2341,13 +2369,7 @@ function! s:RunWait(state, job) abort
endwhile endwhile
sleep 1m sleep 1m
echo echo
if get(a:state, 'request', '') == 'edit' call s:RunEdit(a:state, a:job)
call remove(a:state, 'request')
let file = readfile(a:state.temp . '.edit')[0]
exe substitute(a:state.mods, '\<tab\>', '-tab', 'g') 'keepalt split' s:fnameescape(file)
set bufhidden=wipe
let s:edit_jobs[bufnr('')] = [a:state, a:job]
endif
let finished = 1 let finished = 1
finally finally
if !finished if !finished
@ -2538,7 +2560,14 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort
endif endif
endif endif
if s:RunJobs() if s:RunJobs()
let state = {'dir': dir, 'mods': s:Mods(a:mods), 'temp': tempname(), 'log': []} let state = {
\ 'dir': dir,
\ 'mods': s:Mods(a:mods),
\ 'title': ':Git ' . a:arg,
\ 'echo_buffer': '',
\ 'escape_buffer': '',
\ 'log': [],
\ 'temp': tempname()}
let state.pty = get(g:, 'fugitive_pty', has('unix') && (has('patch-8.0.0744') || has('nvim'))) let state.pty = get(g:, 'fugitive_pty', has('unix') && (has('patch-8.0.0744') || has('nvim')))
if !state.pty if !state.pty
let args = s:AskPassArgs(dir) + args let args = s:AskPassArgs(dir) + args
@ -3598,6 +3627,10 @@ function! s:DoToggleHeadHeader(value) abort
call search('\C^index$', 'wc') call search('\C^index$', 'wc')
endfunction endfunction
function! s:DoToggleHelpHeader(value) abort
exe 'help fugitive-map'
endfunction
function! s:DoStagePushHeader(value) abort function! s:DoStagePushHeader(value) abort
let remote = matchstr(a:value, '\zs[^/]\+\ze/') let remote = matchstr(a:value, '\zs[^/]\+\ze/')
if empty(remote) if empty(remote)
@ -4157,14 +4190,13 @@ function! s:GrepSubcommand(line1, line2, range, bang, mods, options) abort
let args = args[1:-1] let args = args[1:-1]
endif endif
let name_only = s:HasOpt(args, '-l', '--files-with-matches', '--name-only', '-L', '--files-without-match') let name_only = s:HasOpt(args, '-l', '--files-with-matches', '--name-only', '-L', '--files-without-match')
let title = [listnr < 0 ? ':Ggrep' : ':Glgrep'] + args
if listnr > 0 if listnr > 0
exe listnr 'wincmd w' exe listnr 'wincmd w'
else else
call s:BlurStatus() call s:BlurStatus()
endif endif
redraw redraw
call s:QuickfixCreate(listnr, {'title': (listnr < 0 ? ':Ggrep ' : ':Glgrep ') . s:fnameescape(args)}) call s:QuickfixCreate(listnr, {'title': (listnr < 0 ? ':Git grep ' : ':0Git grep ') . s:fnameescape(args)})
let tempfile = tempname() let tempfile = tempname()
let event = listnr < 0 ? 'grep-fugitive' : 'lgrep-fugitive' let event = listnr < 0 ? 'grep-fugitive' : 'lgrep-fugitive'
silent exe s:DoAutocmd('QuickFixCmdPre ' . event) silent exe s:DoAutocmd('QuickFixCmdPre ' . event)
@ -4742,18 +4774,6 @@ function! fugitive#FetchComplete(A, L, P, ...) abort
return s:CompleteSub('fetch', a:A, a:L, a:P, function('s:CompleteRemote'), a:000) return s:CompleteSub('fetch', a:A, a:L, a:P, function('s:CompleteRemote'), a:000)
endfunction endfunction
function! s:AskPassArgs(dir) abort
if (len($DISPLAY) || len($TERM_PROGRAM) || has('gui_running')) && fugitive#GitVersion(1, 8) &&
\ empty($GIT_ASKPASS) && empty($SSH_ASKPASS) && empty(FugitiveConfigGetAll('core.askpass', a:dir))
if s:executable(s:ExecPath() . '/git-gui--askpass')
return ['-c', 'core.askPass=' . s:ExecPath() . '/git-gui--askpass']
elseif s:executable('ssh-askpass')
return ['-c', 'core.askPass=ssh-askpass']
endif
endif
return []
endfunction
function! s:Dispatch(bang, options) abort function! s:Dispatch(bang, options) abort
let dir = a:options.dir let dir = a:options.dir
exe s:DirCheck(dir) exe s:DirCheck(dir)
@ -4797,11 +4817,11 @@ endfunction
augroup fugitive_diff augroup fugitive_diff
autocmd! autocmd!
autocmd BufWinLeave * autocmd BufWinLeave * nested
\ if s:can_diffoff(+expand('<abuf>')) && s:diff_window_count() == 2 | \ if s:can_diffoff(+expand('<abuf>')) && s:diff_window_count() == 2 |
\ call s:diffoff_all(s:Dir(+expand('<abuf>'))) | \ call s:diffoff_all(s:Dir(+expand('<abuf>'))) |
\ endif \ endif
autocmd BufWinEnter * autocmd BufWinEnter * nested
\ if s:can_diffoff(+expand('<abuf>')) && s:diff_window_count() == 1 | \ if s:can_diffoff(+expand('<abuf>')) && s:diff_window_count() == 1 |
\ call s:diffoff() | \ call s:diffoff() |
\ endif \ endif
@ -6026,7 +6046,7 @@ function! fugitive#MapJumps(...) abort
call s:Map('n', 'czP', ':<C-U>Git stash pop --quiet stash@{<C-R>=v:count<CR>}<CR>') call s:Map('n', 'czP', ':<C-U>Git stash pop --quiet stash@{<C-R>=v:count<CR>}<CR>')
call s:Map('n', 'czv', ':<C-U>exe "Gedit" fugitive#RevParse("stash@{" . v:count . "}")<CR>', '<silent>') call s:Map('n', 'czv', ':<C-U>exe "Gedit" fugitive#RevParse("stash@{" . v:count . "}")<CR>', '<silent>')
call s:Map('n', 'czw', ':<C-U>Git stash --keep-index<C-R>=v:count > 1 ? " --all" : v:count ? " --include-untracked" : ""<CR><CR>') call s:Map('n', 'czw', ':<C-U>Git stash --keep-index<C-R>=v:count > 1 ? " --all" : v:count ? " --include-untracked" : ""<CR><CR>')
call s:Map('n', 'czz', ':<C-U>Git stash <C-R>=v:count > 1 ? " --all" : v:count ? " --include-untracked" : ""<CR>') call s:Map('n', 'czz', ':<C-U>Git stash <C-R>=v:count > 1 ? " --all" : v:count ? " --include-untracked" : ""<CR><CR>')
call s:Map('n', 'cz?', ':<C-U>help fugitive_cz<CR>', '<silent>') call s:Map('n', 'cz?', ':<C-U>help fugitive_cz<CR>', '<silent>')
call s:Map('n', 'co<Space>', ':Git checkout<Space>') call s:Map('n', 'co<Space>', ':Git checkout<Space>')

View File

@ -8,6 +8,9 @@ syn spell notoplevel
syn include @fugitiveDiff syntax/diff.vim syn include @fugitiveDiff syntax/diff.vim
syn match fugitiveHeader /^[A-Z][a-z][^:]*:/ nextgroup=fugitiveHash,fugitiveSymbolicRef skipwhite syn match fugitiveHeader /^[A-Z][a-z][^:]*:/ nextgroup=fugitiveHash,fugitiveSymbolicRef skipwhite
syn match fugitiveBareHeader /^Bare:/
syn match fugitiveHelpHeader /^Help:/ nextgroup=fugitiveHelpTag skipwhite
syn match fugitiveHelpTag /\S\+/ contained
syn region fugitiveSection start=/^\%(.*(\d\+)$\)\@=/ contains=fugitiveHeading end=/^$/ syn region fugitiveSection start=/^\%(.*(\d\+)$\)\@=/ contains=fugitiveHeading end=/^$/
syn cluster fugitiveSection contains=fugitiveSection syn cluster fugitiveSection contains=fugitiveSection
@ -20,8 +23,8 @@ syn match fugitiveDone /^done\>/ contained containedin=@fugitiveSection nextgrou
syn match fugitiveStop /^stop\>/ contained containedin=@fugitiveSection nextgroup=fugitiveHash skipwhite syn match fugitiveStop /^stop\>/ contained containedin=@fugitiveSection nextgroup=fugitiveHash skipwhite
syn match fugitiveModifier /^[MADRCU?]\{1,2} / contained containedin=@fugitiveSection syn match fugitiveModifier /^[MADRCU?]\{1,2} / contained containedin=@fugitiveSection
syn match fugitiveSymbolicRef /\.\@!\%(\.\.\@!\|[^[:space:][:cntrl:]\:.]\)\+\.\@<!/ contained syn match fugitiveSymbolicRef /\.\@!\%(\.\.\@!\|[^[:space:][:cntrl:]\:.]\)\+\.\@<!/ contained
syn match fugitiveHash /^\x\{4,\}\>/ contained containedin=@fugitiveSection syn match fugitiveHash /^\x\{4,\}\S\@!/ contained containedin=@fugitiveSection
syn match fugitiveHash /\<\x\{4,\}\>/ contained syn match fugitiveHash /\S\@<!\x\{4,\}\S\@!/ contained
syn region fugitiveHunk start=/^\%(@@\+ -\)\@=/ end=/^\%([A-Za-z?@]\|$\)\@=/ contains=@fugitiveDiff containedin=@fugitiveSection fold syn region fugitiveHunk start=/^\%(@@\+ -\)\@=/ end=/^\%([A-Za-z?@]\|$\)\@=/ contains=@fugitiveDiff containedin=@fugitiveSection fold
@ -33,7 +36,10 @@ for s:section in ['Untracked', 'Unstaged', 'Staged']
endfor endfor
unlet s:section unlet s:section
hi def link fugitiveBareHeader fugitiveHeader
hi def link fugitiveHelpHeader fugitiveHeader
hi def link fugitiveHeader Label hi def link fugitiveHeader Label
hi def link fugitiveHelpTag Tag
hi def link fugitiveHeading PreProc hi def link fugitiveHeading PreProc
hi def link fugitiveUntrackedHeading PreCondit hi def link fugitiveUntrackedHeading PreCondit
hi def link fugitiveUnstagedHeading Macro hi def link fugitiveUnstagedHeading Macro

View File

@ -440,19 +440,21 @@ function! s:open_hunk_preview_window()
endif endif
silent! wincmd P silent! wincmd P
if !&previewwindow if &previewwindow
file gitgutter://hunk-preview
else
noautocmd execute g:gitgutter_preview_win_location &previewheight 'new gitgutter://hunk-preview' noautocmd execute g:gitgutter_preview_win_location &previewheight 'new gitgutter://hunk-preview'
doautocmd WinEnter doautocmd WinEnter
if exists('*win_getid')
let s:winid = win_getid()
else
let s:preview_bufnr = bufnr('')
endif
set previewwindow set previewwindow
setlocal filetype=diff buftype=acwrite bufhidden=delete
" Reset some defaults in case someone else has changed them.
setlocal noreadonly modifiable noswapfile
endif endif
if exists('*win_getid')
let s:winid = win_getid()
else
let s:preview_bufnr = bufnr('')
endif
setlocal filetype=diff buftype=acwrite bufhidden=delete
" Reset some defaults in case someone else has changed them.
setlocal noreadonly modifiable noswapfile
endfunction endfunction
@ -460,17 +462,22 @@ endfunction
" Preview window: assumes cursor is in preview window. " Preview window: assumes cursor is in preview window.
function! s:populate_hunk_preview_window(header, body) function! s:populate_hunk_preview_window(header, body)
let body_length = len(a:body) let body_length = len(a:body)
let height = min([body_length, &previewheight])
if g:gitgutter_preview_win_floating if g:gitgutter_preview_win_floating
if exists('*nvim_open_win') if exists('*nvim_open_win')
let height = min([body_length, &previewheight])
" Assumes cursor is not in previewing window. " Assumes cursor is not in previewing window.
call nvim_buf_set_var(winbufnr(s:winid), 'hunk_header', a:header) call nvim_buf_set_var(winbufnr(s:winid), 'hunk_header', a:header)
let [_scrolloff, &scrolloff] = [&scrolloff, 0]
let width = max(map(copy(a:body), 'strdisplaywidth(v:val)')) let width = max(map(copy(a:body), 'strdisplaywidth(v:val)'))
call nvim_win_set_width(s:winid, width) call nvim_win_set_width(s:winid, width)
call nvim_win_set_height(s:winid, height) call nvim_win_set_height(s:winid, height)
let &scrolloff=_scrolloff
call nvim_buf_set_lines(winbufnr(s:winid), 0, -1, v:false, []) call nvim_buf_set_lines(winbufnr(s:winid), 0, -1, v:false, [])
call nvim_buf_set_lines(winbufnr(s:winid), 0, -1, v:false, a:body) call nvim_buf_set_lines(winbufnr(s:winid), 0, -1, v:false, a:body)
call nvim_buf_set_option(winbufnr(s:winid), 'modified', v:false) call nvim_buf_set_option(winbufnr(s:winid), 'modified', v:false)
@ -496,12 +503,16 @@ function! s:populate_hunk_preview_window(header, body)
else else
let b:hunk_header = a:header let b:hunk_header = a:header
execute 'resize' height
%delete _ %delete _
call setline(1, a:body) call setline(1, a:body)
setlocal nomodified setlocal nomodified
normal! G$
let height = min([winline(), &previewheight])
execute 'resize' height
1
call clearmatches() call clearmatches()
for region in gitgutter#diff_highlight#process(a:body) for region in gitgutter#diff_highlight#process(a:body)
let group = region[1] == '+' ? 'GitGutterAddIntraLine' : 'GitGutterDeleteIntraLine' let group = region[1] == '+' ? 'GitGutterAddIntraLine' : 'GitGutterDeleteIntraLine'

View File

@ -1,27 +0,0 @@
" Measure how long it takes to unplace signs.
"
" Source this file with `:source %` or `vim -S unplace.vim`
let num = 500
sign define Foo text=*
new
call append(0, range(1, num))
for i in range(1, num)
execute "sign place ".i." line=".i." name=Foo buffer=".bufnr('')
endfor
let start = reltime()
for i in range(1, num)
execute "sign unplace ".i
endfor
let elapsed = reltime(start)
bdelete!
echom split(reltimestr(elapsed))[0]."s to remove ".num." signs"
echom string(reltimefloat(elapsed) * 1000 / num).' ms/sign'
echom string(float2nr(num / reltimefloat(elapsed))).' sign/s'

View File

@ -4,5 +4,5 @@ fun! s:SelectJavascript()
endif endif
endfun endfun
autocmd BufNewFile,BufRead *.{js,mjs,jsm,es,es6},Jakefile setfiletype javascript autocmd BufNewFile,BufRead *.{js,mjs,cjs,jsm,es,es6},Jakefile setfiletype javascript
autocmd BufNewFile,BufRead * call s:SelectJavascript() autocmd BufNewFile,BufRead * call s:SelectJavascript()

View File

@ -70,10 +70,10 @@ execute 'syn region mkdLink matchgroup=mkdDelimiter start="\\\@<!!\?\[\ze[^]\n]
" Autolink without angle brackets. " Autolink without angle brackets.
" mkd inline links: protocol optional user:pass@ sub/domain .com, .co.uk, etc optional port path/querystring/hash fragment " mkd inline links: protocol optional user:pass@ sub/domain .com, .co.uk, etc optional port path/querystring/hash fragment
" ------------ _____________________ ----------------------------- _________________________ ----------------- __ " ------------ _____________________ ----------------------------- _________________________ ----------------- __
syn match mkdInlineURL /https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z0-9][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?\S*/ syn match mkdInlineURL /https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z0-9][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?[^] \t]*/
" Autolink with parenthesis. " Autolink with parenthesis.
syn region mkdInlineURL matchgroup=mkdDelimiter start="(\(https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z0-9][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?\S*)\)\@=" end=")" syn region mkdInlineURL matchgroup=mkdDelimiter start="(\(https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z0-9][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?[^] \t]*)\)\@=" end=")"
" Autolink with angle brackets. " Autolink with angle brackets.
syn region mkdInlineURL matchgroup=mkdDelimiter start="\\\@<!<\ze[a-z][a-z0-9,.-]\{1,22}:\/\/[^> ]*>" end=">" syn region mkdInlineURL matchgroup=mkdDelimiter start="\\\@<!<\ze[a-z][a-z0-9,.-]\{1,22}:\/\/[^> ]*>" end=">"

View File

@ -634,7 +634,8 @@ Given markdown;
Execute (link with url title): Execute (link with url title):
AssertEqual SyntaxOf('https://domain.tld'), 'mkdInlineURL' AssertEqual SyntaxOf('https://domain.tld'), 'mkdInlineURL'
AssertEqual SyntaxOf('https://domain.com'), 'mkdInlineURL' AssertNotEqual SyntaxOf(']'), 'mkdInlineURL'
AssertEqual SyntaxOf('https://domain.com'), 'mkdURL'
AssertNotEqual SyntaxOf('not_a_link'), 'mkdInlineURL' AssertNotEqual SyntaxOf('not_a_link'), 'mkdInlineURL'
# Code Blocks # Code Blocks

View File

@ -1,11 +1,12 @@
sudo: false os: linux
dist: bionic
language: ruby language: ruby
addons: addons:
apt: apt:
packages: packages:
- vim-gtk - vim-gtk
- xvfb
before_script: script:
- "export DISPLAY=:99.0" - xvfb-run bundle exec rake
- "sh -e /etc/init.d/xvfb start"

View File

@ -2,7 +2,7 @@ GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
diff-lcs (1.2.5) diff-lcs (1.2.5)
rake (12.3.3) rake (10.4.2)
rspec (3.4.0) rspec (3.4.0)
rspec-core (~> 3.4.0) rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0) rspec-expectations (~> 3.4.0)

View File

@ -1,5 +1,5 @@
# vim-multiple-cursors # vim-multiple-cursors
[![Build Status](https://travis-ci.org/terryma/vim-multiple-cursors.svg)](https://travis-ci.org/terryma/vim-multiple-cursors) [![Build Status](https://travis-ci.org/terryma/vim-multiple-cursors.svg?branch=master)](https://travis-ci.org/github/terryma/vim-multiple-cursors)
## Contents ## Contents
- [About](#about) - [About](#about)

View File

@ -1285,7 +1285,7 @@ function! s:wait_for_user_input(mode)
call s:start_latency_measure() call s:start_latency_measure()
" Clears any echoes we might've added " Clears any echoes we might've added
normal! :<Esc> normal! :
" add chars to s:char if it start like a special/quit key " add chars to s:char if it start like a special/quit key
let is_special_key = 0 let is_special_key = 0

View File

@ -136,7 +136,7 @@ endsnippet
snippet detail "Disclosure" snippet detail "Disclosure"
<details${3: open=""}> <details${3: open=""}>
${1:summary>${2}</summary>}$0 ${1:<summary>${2}</summary>}$0
</details> </details>
endsnippet endsnippet

View File

@ -17,13 +17,13 @@ pub fn ${1:function_name}($2)${3/..*/ -> /}$3 {
endsnippet endsnippet
snippet afn "async fn name(?) -> ? {}" snippet afn "async fn name(?) -> ? {}"
fn ${1:function_name}($2)${3/..*/ -> /}$3 { async fn ${1:function_name}($2)${3/..*/ -> /}$3 {
${VISUAL}$0 ${VISUAL}$0
} }
endsnippet endsnippet
snippet pafn "pub async fn name(?) -> ? {}" snippet pafn "pub async fn name(?) -> ? {}"
pub fn ${1:function_name}($2)${3/..*/ -> /}$3 { pub async fn ${1:function_name}($2)${3/..*/ -> /}$3 {
${VISUAL}$0 ${VISUAL}$0
} }
endsnippet endsnippet
@ -44,4 +44,10 @@ snippet .it ".iter()" i
.iter()$0 .iter()$0
endsnippet endsnippet
snippet impl "Struct/Trait implementation" b
impl ${1:Type/Trait}${2: for ${3:Type}} {
$0
}
endsnippet
# vim:ft=snippets: # vim:ft=snippets:

View File

@ -175,7 +175,7 @@ snippet aside#
${0} ${0}
</aside> </aside>
snippet audio snippet audio
<audio src="${1}>${0}</audio> <audio src="${1}">${0}</audio>
snippet b snippet b
<b>${0}</b> <b>${0}</b>
snippet base snippet base

View File

@ -122,6 +122,10 @@ snippet ife "if / else"
} else { } else {
${0} ${0}
} }
snippet ifl "if let (...)"
if let ${1:Some(${2})} = $3 {
${0:${VISUAL}}
}
snippet el "else" snippet el "else"
else { else {
${0:${VISUAL}} ${0:${VISUAL}}
@ -146,6 +150,10 @@ snippet wh "while loop"
while ${1:condition} { while ${1:condition} {
${0:${VISUAL}} ${0:${VISUAL}}
} }
snippet whl "while let (...)"
while let ${1:Some(${2})} = $3 {
${0:${VISUAL}}
}
snippet for "for ... in ... loop" snippet for "for ... in ... loop"
for ${1:i} in ${2} { for ${1:i} in ${2} {
${0} ${0}
@ -157,21 +165,21 @@ snippet fixme "FIXME comment"
// FIXME: $0 // FIXME: $0
# Struct # Struct
snippet st "Struct definition" snippet st "Struct definition"
struct ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} { struct ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}${2:<${3:T}>} {
${0} ${0}
} }
snippet impl "Struct/Trait implementation" snippet impl "Struct/Trait implementation"
impl ${1:Type/Trait}${2: for ${3:Type}} { impl$4 ${1:Type/Trait}${2: for ${3:Type}}${4:<${5:T}>} {
${0} ${0}
} }
snippet stn "Struct with new constructor" snippet stn "Struct with new constructor"
pub struct ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} { pub struct ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}${2:<${3:T}>} {
${0} ${0}
} }
impl $1 { impl$2 $1$2 {
pub fn new(${2}) -> Self { pub fn new(${4}) -> Self {
$1 { ${3} } $1 { ${5} }
} }
} }
snippet ty "Type alias" snippet ty "Type alias"
@ -190,7 +198,7 @@ snippet trait "Trait definition"
${0} ${0}
} }
snippet drop "Drop trait implementation (destructor)" snippet drop "Drop trait implementation (destructor)"
impl Drop for ${1:Name} { impl$2 Drop for ${1:Name}${2:<${3:T}>} {
fn drop(&mut self) { fn drop(&mut self) {
${0} ${0}
} }
@ -238,9 +246,11 @@ snippet macro "macro_rules!" b
$3 $3
) )
} }
snippet box "Box::new()" snippet boxp "Box::new()"
Box::new(${0:${VISUAL}}) Box::new(${0:${VISUAL}})
snippet rc "Rc::new()" snippet rc "Rc::new()"
Rc::new(${0:${VISUAL}}) Rc::new(${0:${VISUAL}})
snippet unim "unimplemented!()" snippet unim "unimplemented!()"
unimplemented!() unimplemented!()
snippet use "use ...;" b
use ${1:std::${2:io}};