1
0
Fork 0
mirror of synced 2024-12-30 10:29:25 -05:00

Updated plugins

This commit is contained in:
Amir 2022-11-20 12:21:23 +01:00
parent 0ebb4622e9
commit b8073ac5c4
57 changed files with 578 additions and 101 deletions

View file

@ -1,5 +1,5 @@
" Author: kmarc <korondi.mark@gmail.com>
" Description: This file adds support for using GNU awk with sripts.
" Description: This file adds support for using GNU awk with scripts.
call ale#Set('awk_gawk_executable', 'gawk')
call ale#Set('awk_gawk_options', '')

View file

@ -26,7 +26,7 @@ function! ale_linters#cpp#clangtidy#GetCommand(buffer, output) abort
" Tell clang-tidy a .h header with a C++ filetype in Vim is a C++ file
" only when compile-commands.json file is not there. Adding these
" flags makes clang-tidy completely ignore compile commmands.
" flags makes clang-tidy completely ignore compile commands.
if expand('#' . a:buffer) =~# '\.h$'
let l:options .= !empty(l:options) ? ' -x c++' : '-x c++'
endif

View file

@ -3,6 +3,7 @@
" always, yes, never
call ale#Set('dockerfile_hadolint_use_docker', 'never')
call ale#Set('dockerfile_hadolint_docker_image', 'hadolint/hadolint')
call ale#Set('dockerfile_hadolint_options', '')
function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
" Matches patterns line the following:
@ -102,7 +103,7 @@ endfunction
function! ale_linters#dockerfile#hadolint#GetCommand(buffer) abort
let l:command = ale_linters#dockerfile#hadolint#GetExecutable(a:buffer)
let l:opts = '--no-color -'
let l:opts = ale#Var(a:buffer, 'dockerfile_hadolint_options') . ' --no-color -'
if l:command is# 'docker'
return printf('docker run --rm -i %s hadolint %s',

View file

@ -0,0 +1,49 @@
" Author: Dmitri Vereshchagin <dmitri.vereshchagin@gmail.com>
" Description: LSP linter for Erlang files
call ale#Set('erlang_erlang_ls_executable', 'erlang_ls')
call ale#Set('erlang_erlang_ls_log_dir', '')
call ale#Set('erlang_erlang_ls_log_level', 'info')
function! s:GetCommand(buffer) abort
let l:log_dir = ale#Var(a:buffer, 'erlang_erlang_ls_log_dir')
let l:log_level = ale#Var(a:buffer, 'erlang_erlang_ls_log_level')
let l:command = '%e'
if !empty(l:log_dir)
let l:command .= ' --log-dir=' . ale#Escape(l:log_dir)
endif
let l:command .= ' --log-level=' . ale#Escape(l:log_level)
return l:command
endfunction
function! s:FindProjectRoot(buffer) abort
let l:markers = ['_build/', 'erlang_ls.config', 'rebar.lock']
" This is a way to find Erlang/OTP root (the one that is managed
" by kerl or asdf). Useful if :ALEGoToDefinition takes us there.
let l:markers += ['.kerl_config']
for l:marker in l:markers
let l:path = l:marker[-1:] is# '/'
\ ? ale#path#FindNearestDirectory(a:buffer, l:marker)
\ : ale#path#FindNearestFile(a:buffer, l:marker)
if !empty(l:path)
return ale#path#Dirname(l:path)
endif
endfor
return ''
endfunction
call ale#linter#Define('erlang', {
\ 'name': 'erlang_ls',
\ 'executable': {b -> ale#Var(b, 'erlang_erlang_ls_executable')},
\ 'command': function('s:GetCommand'),
\ 'lsp': 'stdio',
\ 'project_root': function('s:FindProjectRoot'),
\})

View file

@ -1,5 +1,7 @@
" Author: aurieh - https://github.com/aurieh
call ale#Set('make_checkmake_config', '')
function! ale_linters#make#checkmake#Handle(buffer, lines) abort
let l:pattern = '\v^(\d+):(.+):(.+)$'
let l:output = []
@ -17,9 +19,19 @@ function! ale_linters#make#checkmake#Handle(buffer, lines) abort
return l:output
endfunction
function! ale_linters#make#checkmake#GetCommand(buffer) abort
let l:config = ale#Var(a:buffer, 'make_checkmake_config')
let l:cmd = 'checkmake'
\ . ' --format="{{.LineNumber}}:{{.Rule}}:{{.Violation}}{{\"\r\n\"}}"'
\ . (!empty(l:config) ? ' --config="' . l:config . '"' : '')
\ . ' %s'
return l:cmd
endfunction
call ale#linter#Define('make', {
\ 'name': 'checkmake',
\ 'executable': 'checkmake',
\ 'command': 'checkmake %s --format="{{.LineNumber}}:{{.Rule}}:{{.Violation}}{{\"\r\n\"}}"',
\ 'command': function('ale_linters#make#checkmake#GetCommand'),
\ 'callback': 'ale_linters#make#checkmake#Handle',
\})

View file

@ -17,7 +17,7 @@ function! ale_linters#matlab#mlint#Handle(buffer, lines) abort
let l:code = l:match[3]
let l:text = l:match[4]
" Suppress erroneous waring about filename
" Suppress erroneous warning about filename
" TODO: Enable this error when copying filename is supported
if l:code is# 'FNDEF'
continue

View file

@ -0,0 +1,84 @@
" Author: Yining <zhang.yining@gmail.com>
" Description: ruff as linter for python files
call ale#Set('python_ruff_executable', 'ruff')
call ale#Set('python_ruff_options', '')
call ale#Set('python_ruff_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('python_ruff_change_directory', 1)
call ale#Set('python_ruff_auto_pipenv', 0)
call ale#Set('python_ruff_auto_poetry', 0)
call ale#fix#registry#Add('ruff',
\ 'ale#fixers#ruff#Fix',
\ ['python'],
\ 'A python linter/fixer for Python written in Rust'
\)
function! ale_linters#python#ruff#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_ruff_auto_pipenv'))
\ && ale#python#PipenvPresent(a:buffer)
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_ruff_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
return ale#python#FindExecutable(a:buffer, 'python_ruff', ['ruff'])
endfunction
function! ale_linters#python#ruff#GetCwd(buffer) abort
if ale#Var(a:buffer, 'python_ruff_change_directory')
" Run from project root if found, else from buffer dir.
let l:project_root = ale#python#FindProjectRoot(a:buffer)
return !empty(l:project_root) ? l:project_root : '%s:h'
endif
return ''
endfunction
function! ale_linters#python#ruff#GetCommand(buffer, version) abort
let l:executable = ale_linters#python#ruff#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run ruff'
\ : ''
" NOTE: ruff version `0.0.69` supports liniting input from stdin
return ale#Escape(l:executable) . l:exec_args
\ . ale#Pad(ale#Var(a:buffer, 'python_ruff_options'))
\ . ' --format text'
\ . (ale#semver#GTE(a:version, [0, 0, 69]) ? ' -' : ' %s')
endfunction
function! ale_linters#python#ruff#Handle(buffer, lines) abort
"Example: path/to/file.py:10:5: E999 SyntaxError: unexpected indent
let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):(\d+)?:? (.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\ 'text': l:match[3],
\})
endfor
return l:output
endfunction
call ale#linter#Define('python', {
\ 'name': 'ruff',
\ 'executable': function('ale_linters#python#ruff#GetExecutable'),
\ 'cwd': function('ale_linters#python#ruff#GetCwd'),
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
\ buffer,
\ ale_linters#python#ruff#GetExecutable(buffer),
\ '%e --version',
\ function('ale_linters#python#ruff#GetCommand'),
\ )},
\ 'callback': 'ale_linters#python#ruff#Handle',
\ 'output_stream': 'both',
\ 'read_buffer': 1,
\})

View file

@ -13,7 +13,7 @@ function! ale_linters#tex#lacheck#Handle(buffer, lines) abort
for l:match in ale#util#GetMatches(a:lines, l:pattern)
" lacheck follows `\input{}` commands. If the cwd is not the same as the
" file in the buffer then it will fail to find the inputed items. We do not
" file in the buffer then it will fail to find the inputted items. We do not
" want warnings from those items anyway
if !empty(matchstr(l:match[3], '^Could not open ".\+"$'))
continue

View file

@ -216,7 +216,7 @@ function! s:UpdateCursor(cursor, start, end, offset) abort
" to the end of the changes
let l:cur_line = l:end_line + l:line_offset
let l:cur_column = l:end_column + l:column_offset
" else is not necesary, it means modifications are happening
" else is not necessary, it means modifications are happening
" after the cursor so no cursor updates need to be done
endif
endif

View file

@ -130,6 +130,7 @@ let s:should_complete_map = {
\ '<default>': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$',
\ 'clojure': s:lisp_regex,
\ 'lisp': s:lisp_regex,
\ 'racket': '\k\+$',
\ 'typescript': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$|''$|"$',
\ 'rust': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$|::$',
\ 'cpp': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$|::$|-\>$',

View file

@ -570,6 +570,11 @@ let s:default_registry = {
\ 'function': 'ale#fixers#zigfmt#Fix',
\ 'suggested_filetypes': ['zig'],
\ 'description': 'Official formatter for Zig',
\ },
\ 'raco_fmt': {
\ 'function': 'ale#fixers#raco_fmt#Fix',
\ 'suggested_filetypes': ['racket'],
\ 'description': 'Fix Racket files with raco fmt.',
\ }
\}

View file

@ -0,0 +1,15 @@
" Author: Jeremy Cantrell <jmcantrell@gmail.com>
" Description: Integration of raco fmt with ALE.
call ale#Set('racket_raco_fmt_executable', 'raco')
call ale#Set('racket_raco_fmt_options', '')
function! ale#fixers#raco_fmt#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'racket_raco_fmt_executable')
let l:options = ale#Var(a:buffer, 'racket_raco_fmt_options')
return {
\ 'command': ale#Escape(l:executable) . ' fmt'
\ . (empty(l:options) ? '' : ' ' . l:options),
\}
endfunction

View file

@ -0,0 +1,54 @@
" Author: Yining <zhang.yining@gmail.com>
" Description: ruff as ALE fixer for python files
function! ale#fixers#ruff#GetCwd(buffer) abort
if ale#Var(a:buffer, 'python_ruff_change_directory')
" Run from project root if found, else from buffer dir.
let l:project_root = ale#python#FindProjectRoot(a:buffer)
return !empty(l:project_root) ? l:project_root : '%s:h'
endif
return ''
endfunction
function! ale#fixers#ruff#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_ruff_auto_pipenv'))
\ && ale#python#PipenvPresent(a:buffer)
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_ruff_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
return ale#python#FindExecutable(a:buffer, 'python_ruff', ['ruff'])
endfunction
function! ale#fixers#ruff#GetCommand(buffer, version) abort
let l:executable = ale_linters#python#ruff#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run ruff'
\ : ''
" NOTE: ruff version `0.0.72` implement `--fix` with stdin
return ale#Escape(l:executable) . l:exec_args
\ . ale#Pad(ale#Var(a:buffer, 'python_ruff_options'))
\ . ' --fix'
\ . (ale#semver#GTE(a:version, [0, 0, 72]) ? ' -' : ' %s')
endfunction
function! ale#fixers#ruff#Fix(buffer) abort
let l:fix_cmd = {buffer -> ale#semver#RunWithVersionCheck(
\ buffer,
\ ale#fixers#ruff#GetExecutable(buffer),
\ '%e --version',
\ function('ale#fixers#ruff#GetCommand'),
\ )}(a:buffer)
return {
\ 'cwd': ale#fixers#ruff#GetCwd(a:buffer),
\ 'command': l:fix_cmd,
\}
endfunction

View file

@ -13,7 +13,7 @@ function! ale#handlers#hdl_checker#IsDotGit(path) abort
return ! empty(a:path) && isdirectory(a:path)
endfunction
" Sould return (in order of preference)
" Should return (in order of preference)
" 1. Nearest config file
" 2. Nearest .git directory
" 3. The current path

View file

@ -1,7 +1,7 @@
" Author: Horacio Sanson https://github.com/hsanson
" Description: Functions for integrating with Java tools
" Find the nearest dir contining a gradle or pom file and asume it
" Find the nearest dir contining a gradle or pom file and assume it
" the root of a java app.
function! ale#java#FindProjectRoot(buffer) abort
let l:gradle_root = ale#gradle#FindProjectRoot(a:buffer)

View file

@ -18,7 +18,7 @@ if !exists('s:timer_args')
let s:timer_args = {}
endif
" Return 1 if there is a buffer with buftype == 'quickfix' in bufffer list
" Return 1 if there is a buffer with buftype == 'quickfix' in buffer list
function! ale#list#IsQuickfixOpen() abort
let l:res = getqflist({ 'winid' : winnr() })
@ -190,7 +190,7 @@ function! s:RestoreViewIfNeeded(buffer) abort
return
endif
" Check wether the cursor has moved since linting was actually requested. If
" Check whether the cursor has moved since linting was actually requested. If
" the user has indeed moved lines, do nothing
let l:current_view = winsaveview()

View file

@ -434,7 +434,7 @@ function! ale#lsp_linter#StartLSP(buffer, linter, Callback) abort
if empty(l:root) && a:linter.lsp isnot# 'tsserver'
" If there's no project root, then we can't check files with LSP,
" unless we are using tsserver, which doesn't use project roots.
call ale#lsp_linter#AddErrorMessage(a:linter.name, "Failed to find project root, language server wont't start.")
call ale#lsp_linter#AddErrorMessage(a:linter.name, "Failed to find project root, language server won't start.")
return 0
endif

View file

@ -37,6 +37,16 @@ hadolint *ale-dockerfile-hadolint*
hadolint can be found at: https://github.com/hadolint/hadolint
g:ale_dockerfile_hadolint_options *g:ale_dockerfile_hadolint_options*
*b:ale_dockerfile_hadolint_options*
Type: |String|
Default: `''`
This variable can be changed to add command-line arguments to the hadolint
invocation. These arguments will be used whether docker is being used or not
(see below).
g:ale_dockerfile_hadolint_use_docker *g:ale_dockerfile_hadolint_use_docker*
*b:ale_dockerfile_hadolint_use_docker*
Type: |String|

View file

@ -51,6 +51,31 @@ g:ale_erlang_elvis_executable *g:ale_erlang_elvis_executable*
This variable can be changed to specify the elvis executable.
-------------------------------------------------------------------------------
erlang_ls *ale-erlang-erlang_ls*
g:ale_erlang_erlang_ls_executable *g:ale_erlang_erlang_ls_executable*
*b:ale_erlang_erlang_ls_executable*
Type: |String|
Default: `'erlang_ls'`
This variable can be changed to specify the erlang_ls executable.
g:ale_erlang_erlang_ls_log_dir *g:ale_erlang_erlang_ls_log_dir*
*b:ale_erlang_erlang_ls_log_dir*
Type: |String|
Default: `''`
If set this variable overrides default directory where logs will be written.
g:ale_erlang_erlang_ls_log_level *g:ale_erlang_erlang_ls_log_level*
*b:ale_erlang_erlang_ls_log_level*
Type: |String|
Default: `'info'`
This variable can be changed to specify log level.
-------------------------------------------------------------------------------
erlc *ale-erlang-erlc*

View file

@ -39,7 +39,7 @@ ruumba *ale-eruby-ruumba*
g:ale_eruby_ruumba_executable *g:ale_eruby_ruumba_executable*
*b:ale_eruby_ruumba_executable*
Type: String
Type: |String|
Default: `'ruumba`
Override the invoked ruumba binary. This is useful for running ruumba

View file

@ -169,7 +169,7 @@ g:ale_go_golines_executable *g:ale_go_lines_executable*
g:ale_go_golines_options *g:ale_go_golines_options*
*b:ale_go_golines_options*
Type: |String|
Default: ''
Default: `''`
Additional options passed to the golines command. By default golines has
--max-length=100 (lines above 100 characters will be wrapped)

View file

@ -123,8 +123,8 @@ g:ale_haskell_hlint_executable *g:ale_haskell_hlint_executable*
g:ale_haskell_hlint_options g:ale_haskell_hlint_options
b:ale_haskell_hlint_options
Type: String
Default: ''
Type: |String|
Default: `''`
This variable can be used to pass extra options to the underlying hlint
executable.
@ -217,8 +217,8 @@ g:ale_haskell_ormolu_executable *g:ale_haskell_ormolu_executable*
g:ale_haskell_ormolu_options *g:ale_haskell_ormolu_options*
*b:ale_haskell_ormolu_options*
Type: String
Default: ''
Type: |String|
Default: `''`
This variable can be used to pass extra options to the underlying ormolu
executable.

View file

@ -24,7 +24,7 @@ g:ale_java_checkstyle_executable *g:ale_java_checkstyle_executable*
*b:ale_java_checkstyle_executable*
Type: |String|
Default: 'checkstyle'
Default: `'checkstyle'`
This variable can be changed to modify the executable used for checkstyle.
@ -124,8 +124,8 @@ pmd *ale-java-pmd*
g:ale_java_pmd_options *g:ale_java_pmd_options*
*b:ale_java_pmd_options*
Type: String
Default: '-R category/java/bestpractices'
Type: |String|
Default: `'-R category/java/bestpractices'`
This variable can be changed to modify flags given to PMD. Do not specify -f
and -d. They are added automatically.
@ -173,7 +173,7 @@ g:ale_java_javalsp_config *g:ale_java_javalsp_config*
Type: |Dictionary|
Default: `{}`
The javalsp linter automatically detects external depenencies for Maven and
The javalsp linter automatically detects external dependencies for Maven and
Gradle projects. In case the javalsp fails to detect some of them, you can
specify them setting a dictionary to |g:ale_java_javalsp_config| variable.
>

View file

@ -11,7 +11,7 @@ g:ale_julia_executable *g:ale_julia_executable*
*b:ale_julia_executable*
Type: |String|
Default: 'julia'
Default: `'julia'`
Path to the julia exetuable.

View file

@ -79,7 +79,7 @@ g:ale_kotlin_ktlint_executable *g:ale_kotlin_ktlint_executable*
g:ale_kotlin_ktlint_rulesets *g:ale_kotlin_ktlint_rulesets*
Type: |List| of |String|s
Default: []
Default: `[]`
This list should contain paths to ruleset jars and/or strings of maven
artifact triples. Example:

View file

@ -9,7 +9,7 @@ g:ale_llvm_llc_executable *g:ale_llvm_llc_executable*
*b:ale_llvm_llc_executable*
Type: |String|
Default: "llc"
Default: `"llc"`
The command to use for checking. This variable is useful when llc command
has suffix like "llc-5.0".

View file

@ -0,0 +1,18 @@
===============================================================================
ALE Make Integration *ale-make-options*
===============================================================================
checkmake *ale-make-checkmake*
g:ale_make_checkmake_config *g:ale_make_checkmake_config*
*b:ale_make_checkmake_config*
Type: |String|
Default: `''`
This variable can be used to set the `--config` option of checkmake command.
if the value is empty, the checkmake command will not be invoked with the
option.
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View file

@ -72,7 +72,7 @@ g:ale_perl_perlcritic_options *g:ale_perl_perlcritic_options*
g:ale_perl_perlcritic_showrules *g:ale_perl_perlcritic_showrules*
Type: |Number|
Default: 0
Default: `0`
Controls whether perlcritic rule names are shown after the error message.
Defaults to off to reduce length of message.

View file

@ -13,7 +13,7 @@ powershell *ale-powershell-powershell*
g:ale_powershell_powershell_executable *g:ale_powershell_powershell_executable*
*b:ale_powershell_powershell_executable*
Type: String
Type: |String|
Default: `'pwsh'`
This variable can be changed to use a different executable for powershell.

View file

@ -25,7 +25,7 @@ buf-format *ale-proto-buf-format*
g:ale_proto_buf_format_executable *g:ale_proto_buf_format_executable*
Type: |String|
Default: 'buf'
Default: `'buf'`
This variable can be changed to modify the executable used for buf.
@ -39,7 +39,7 @@ buf-lint *ale-proto-buf-lint*
g:ale_proto_buf_lint_executable *g:ale_proto_buf_lint_executable*
Type: |String|
Default: 'buf'
Default: `'buf'`
This variable can be changed to modify the executable used for buf.
@ -80,7 +80,7 @@ protolint *ale-proto-protolint
g:ale_proto_protolint_executable *g:ale_proto_protolint_executable*
Type: |String|
Default: 'protolint'
Default: `'protolint'`
This variable can be changed to modify the executable used for protolint.

View file

@ -48,7 +48,7 @@ g:ale_purescript_tidy_use_global *g:ale_purescript_tidy_use_global*
g:ale_purescript_tidy_options *g:ale_purescript_tidy_options*
*b:ale_purescript_tidy_options*
Type: String
Type: |String|
Default: `''`
This variable can be set to pass in additional option to the 'purs-tidy'

View file

@ -979,7 +979,7 @@ g:ale_python_pylsp_options *g:ale_python_pylsp_options
let g:ale_python_pylsp_executable = 'python3'
let g:ale_python_pylsp_options = '-m pylsp'
An example stragety for installing `pylsp`:
An example strategy for installing `pylsp`:
`python3 -m pip install --user pylsp`
@ -1115,6 +1115,69 @@ g:ale_python_reorder_python_imports_use_global
See |ale-integrations-local-executables|
===============================================================================
ruff *ale-python-ruff*
g:ale_python_ruff_change_directory *g:ale_python_ruff_change_directory*
*b:ale_python_ruff_change_directory*
Type: |Number|
Default: `1`
If set to `1`, `ruff` will be run from a detected project root, per
|ale-python-root|. if set to `0` or no project root detected,
`ruff` will be run from the buffer's directory.
g:ale_python_ruff_executable *g:ale_python_ruff_executable*
*b:ale_python_ruff_executable*
Type: |String|
Default: `'ruff'`
See |ale-integrations-local-executables|
Set this to `'pipenv'` to invoke `'pipenv` `run` `ruff'`.
Set this to `'poetry'` to invoke `'poetry` `run` `ruff'`.
g:ale_python_ruff_options *g:ale_python_ruff_options*
*b:ale_python_ruff_options*
Type: |String|
Default: `''`
This variable can be changed to add command-line arguments to the ruff
invocation.
For example, to select/enable and/or disable some error codes,
you may want to set >
let g:ale_python_ruff_options = '--ignore F401'
g:ale_python_ruff_use_global *g:ale_python_ruff_use_global*
*b:ale_python_ruff_use_global*
Type: |Number|
Default: `get(g:, 'ale_use_global_executables', 0)`
See |ale-integrations-local-executables|
g:ale_python_ruff_auto_pipenv *g:ale_python_ruff_auto_pipenv*
*b:ale_python_ruff_auto_pipenv*
Type: |Number|
Default: `0`
Detect whether the file is inside a pipenv, and set the executable to `pipenv`
if true. This is overridden by a manually-set executable.
g:ale_python_ruff_auto_poetry *g:ale_python_ruff_auto_poetry*
*b:ale_python_ruff_auto_poetry*
Type: |Number|
Default: `0`
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
===============================================================================
unimport *ale-python-unimport*

View file

@ -7,7 +7,7 @@ brakeman *ale-ruby-brakeman*
g:ale_ruby_brakeman_executable *g:ale_ruby_brakeman_executable*
*b:ale_ruby_brakeman_executable*
Type: String
Type: |String|
Default: `'brakeman'`
Override the invoked brakeman binary. Set this to `'bundle'` to invoke
@ -33,7 +33,7 @@ debride *ale-ruby-debride*
g:ale_ruby_debride_executable *g:ale_ruby_debride_executable*
*b:ale_ruby_debride_executable*
Type: String
Type: |String|
Default: `'debride'`
Override the invoked debride binary. Set this to `'bundle'` to invoke
@ -60,7 +60,7 @@ rails_best_practices *ale-ruby-rails_best_practices*
g:ale_ruby_rails_best_practices_executable
*g:ale_ruby_rails_best_practices_executable*
*b:ale_ruby_rails_best_practices_executable*
Type: String
Type: |String|
Default: `'rails_best_practices'`
Override the invoked rails_best_practices binary. Set this to `'bundle'` to
@ -81,7 +81,7 @@ reek *ale-ruby-reek*
g:ale_ruby_reek_executable *g:ale_ruby_reek_executable*
*b:ale_ruby_reek_executable*
Type: String
Type: |String|
Default: `'reek'`
Override the invoked reek binary. Set this to `'bundle'` to invoke
@ -91,7 +91,7 @@ g:ale_ruby_reek_executable *g:ale_ruby_reek_executable*
g:ale_ruby_reek_show_context *g:ale_ruby_reek_show_context*
*b:ale_ruby_reek_show_context*
Type: |Number|
Default: 0
Default: `0`
Controls whether context is included in the linter message. Defaults to off
because context is usually obvious while viewing a file.
@ -100,7 +100,7 @@ g:ale_ruby_reek_show_context *g:ale_ruby_reek_show_context*
g:ale_ruby_reek_show_wiki_link *g:ale_ruby_reek_show_wiki_link*
*b:ale_ruby_reek_show_wiki_link*
Type: |Number|
Default: 0
Default: `0`
Controls whether linter messages contain a link to an explanatory wiki page
for the type of code smell. Defaults to off to improve readability.
@ -111,7 +111,7 @@ rubocop *ale-ruby-rubocop*
g:ale_ruby_rubocop_executable *g:ale_ruby_rubocop_executable*
*b:ale_ruby_rubocop_executable*
Type: String
Type: |String|
Default: `'rubocop'`
Override the invoked rubocop binary. Set this to `'bundle'` to invoke
@ -128,7 +128,7 @@ g:ale_ruby_rubocop_options *g:ale_ruby_rubocop_options*
g:ale_ruby_rubocop_auto_correct_all *g:ale_ruby_rubocop_auto_correct_all*
*b:ale_ruby_rubocop_auto_correct_all*
Type: Number
Type: |Number|
Default: `0`
This variable can be changed to make rubocop to correct all offenses (unsafe).
@ -139,7 +139,7 @@ ruby *ale-ruby-ruby*
g:ale_ruby_ruby_executable *g:ale_ruby_ruby_executable*
*b:ale_ruby_ruby_executable*
Type: String
Type: |String|
Default: `'ruby'`
This variable can be changed to use a different executable for ruby.
@ -150,7 +150,7 @@ rufo *ale-ruby-rufo*
g:ale_ruby_rufo_executable *g:ale_ruby_rufo_executable*
*b:ale_ruby_rufo_executable*
Type: String
Type: |String|
Default: `'rufo'`
Override the invoked rufo binary. This is useful for running rufo from
@ -162,7 +162,7 @@ solargraph *ale-ruby-solargraph*
g:ale_ruby_solargraph_executable *g:ale_ruby_solargraph_executable*
*b:ale_ruby_solargraph_executable*
Type: String
Type: |String|
Default: `'solargraph'`
Override the invoked solargraph binary. This is useful for running solargraph
@ -174,7 +174,7 @@ sorbet *ale-ruby-sorbet*
g:ale_ruby_sorbet_executable *g:ale_ruby_sorbet_executable*
*b:ale_ruby_sorbet_executable*
Type: String
Type: |String|
Default: `'srb'`
Override the invoked sorbet binary. Set this to `'bundle'` to invoke
@ -204,7 +204,7 @@ standardrb *ale-ruby-standardrb*
g:ale_ruby_standardrb_executable *g:ale_ruby_standardrb_executable*
*b:ale_ruby_standardrb_executable*
Type: String
Type: |String|
Default: `'standardrb'`
Override the invoked standardrb binary. Set this to `'bundle'` to invoke
@ -224,7 +224,7 @@ syntax_tree *ale-ruby-syntax_tree*
g:ale_ruby_syntax_tree_executable *g:ale_ruby_syntax_tree_executable*
*b:ale_ruby_syntax_tree_executable*
Type: String
Type: |String|
Default: `'stree'`
Override the invoked SyntaxTree binary. Set this to `'bundle'` to invoke

View file

@ -261,8 +261,8 @@ g:ale_rust_ignore_error_codes *g:ale_rust_ignore_error_codes*
g:ale_rust_ignore_secondary_spans *g:ale_rust_ignore_secondary_spans*
*b:ale_rust_ignore_secondary_spans*
Type: Number
Default: 0
Type: |Number|
Default: `0`
When set to 1, instructs the Rust error reporting to ignore secondary spans.
The problem with secondary spans is that they sometimes appear in error

View file

@ -178,6 +178,7 @@ Notes:
* `SyntaxErl`
* `dialyzer`!!
* `elvis`!!
* `erlang_ls`
* `erlc`
* `erlfmt`
* Fish
@ -482,6 +483,7 @@ Notes:
* `pyre`
* `pyright`
* `reorder-python-imports`
* ruff
* `unimport`
* `vulture`!!
* `yapf`
@ -495,6 +497,7 @@ Notes:
* Racket
* `racket-langserver`
* `raco`
* `raco_fmt`
* Re:VIEW
* `redpen`
* ReasonML

View file

@ -33,7 +33,7 @@ lacheck *ale-tex-lacheck*
g:ale_lacheck_executable *g:ale_lacheck_executable*
*b:ale_lacheck_executable*
Type: |String|
Default: '`lacheck`'
Default: `'lacheck'`
This variable can be changed to change the path to lacheck.

View file

@ -29,7 +29,7 @@ g:ale_deno_lsp_project_root *g:ale_deno_lsp_project_root*
executing the following steps in the given order:
1. Find an ancestor directory containing a tsconfig.json.
2. Find an ancestory directory containing a .git folder.
2. Find an ancestor directory containing a .git folder.
3. Use the directory of the current buffer (if the buffer was opened from
a file).

View file

@ -134,7 +134,7 @@ g:ale_verilog_yosys_options *g:ale_verilog_yosys_options*
Default: `'-Q -T -p ''read_verilog %s'''`
This variable can be changed to modify the flags/options passed to 'yosys'.
By default, Yosys is an interative program. To obtain linting functionality,
By default, Yosys is an interactive program. To obtain linting functionality,
the `'read_verilog'` command is used.

View file

@ -24,7 +24,7 @@ g:ale_xml_xmllint_options *g:ale_xml_xmllint_options*
g:ale_xml_xmllint_indentsize *g:ale_xml_xmllint_indentsize*
*b:ale_xml_xmllint_indentsize*
Type: |Number|
Default: 2
Default: `2`
This variable can be sent to specify the amount of spaces used for
indentation.

View file

@ -750,7 +750,7 @@ g:airline#extensions#ale#enabled *g:airline#extensions#ale#enabled*
g:ale_cache_executable_check_failures *g:ale_cache_executable_check_failures*
Type: |Number|
Default: undefined
Default: not set
When set to `1`, ALE will cache failing executable checks for linters. By
default, only executable checks which succeed will be cached.
@ -864,7 +864,7 @@ g:ale_completion_enabled *g:ale_completion_enabled*
*g:ale_completion_tsserver_remove_warnings*
g:ale_completion_tsserver_remove_warnings
Type: Number
Type: |Number|
Default: `0`
When this option is set to `0`, ALE will return all completion items,
@ -874,7 +874,7 @@ g:ale_completion_tsserver_remove_warnings
g:ale_completion_autoimport *g:ale_completion_autoimport*
Type: Number
Type: |Number|
Default: `1`
When this option is set to `1`, ALE will try to automatically import
@ -1836,7 +1836,7 @@ g:ale_max_signs *g:ale_max_signs*
g:ale_maximum_file_size *g:ale_maximum_file_size*
*b:ale_maximum_file_size*
Type: |Number|
Default: undefined
Default: not set
A maximum file size in bytes for ALE to check. If set to any positive
number, ALE will skip checking files larger than the given size.
@ -1879,7 +1879,7 @@ g:ale_open_list *g:ale_open_list*
g:ale_pattern_options *g:ale_pattern_options*
Type: |Dictionary|
Default: undefined
Default: not set
This option maps regular expression patterns to |Dictionary| values for
buffer variables. This option can be set to automatically configure
@ -1908,7 +1908,7 @@ g:ale_pattern_options *g:ale_pattern_options*
g:ale_pattern_options_enabled *g:ale_pattern_options_enabled*
Type: |Number|
Default: undefined
Default: not set
This option can be used for disabling pattern options. If set to `0`, ALE
will not set buffer variables per |g:ale_pattern_options|.
@ -1954,7 +1954,7 @@ g:ale_root *g:ale_root*
*b:ale_root*
Type: |Dictionary| or |String|
Default: {}
Default: `{}`
This option is used to determine the project root for a linter. If the value
is a |Dictionary|, it maps a linter to either a |String| containing the
@ -2006,7 +2006,7 @@ g:ale_set_balloons *g:ale_set_balloons*
g:ale_set_balloons_legacy_echo *g:ale_set_balloons_legacy_echo*
*b:ale_set_balloons_legacy_echo*
Type: |Number|
Default: undefined
Default: not set
If set to `1`, moving your mouse over documents in Vim will make ALE ask
`tsserver` or `LSP` servers for information about the symbol where the mouse
@ -2885,6 +2885,7 @@ documented in additional help files.
erlang..................................|ale-erlang-options|
dialyzer..............................|ale-erlang-dialyzer|
elvis.................................|ale-erlang-elvis|
erlang_ls.............................|ale-erlang-erlang_ls|
erlc..................................|ale-erlang-erlc|
erlfmt................................|ale-erlang-erlfmt|
syntaxerl.............................|ale-erlang-syntaxerl|
@ -3036,6 +3037,8 @@ documented in additional help files.
luafmt................................|ale-lua-luafmt|
selene................................|ale-lua-selene|
stylua................................|ale-lua-stylua|
make....................................|ale-make-options|
checkmake.............................|ale-make-checkmake|
markdown................................|ale-markdown-options|
cspell................................|ale-markdown-cspell|
dprint................................|ale-markdown-dprint|
@ -3159,6 +3162,7 @@ documented in additional help files.
pyre..................................|ale-python-pyre|
pyright...............................|ale-python-pyright|
reorder-python-imports................|ale-python-reorder_python_imports|
ruff..................................|ale-python-ruff|
unimport..............................|ale-python-unimport|
vulture...............................|ale-python-vulture|
yapf..................................|ale-python-yapf|
@ -4558,7 +4562,7 @@ ALEFixPost *ALEFixPost-autocmd*
These |User| autocommands are triggered before and after every lint or fix
cycle. They can be used to update statuslines, send notifications, etc.
The autocmd commands are run with |:silent|, so |:unsilent| is required for
echoing messges.
echoing messages.
For example to change the color of the statusline while the linter is
running:
@ -4591,7 +4595,7 @@ ALEJobStarted *ALEJobStarted-autocmd*
ALELSPStarted *ALELSPStarted-autocmd*
*ALELSPStarted*
This |User| autocommand is trigged immediately after an LSP connection is
This |User| autocommand is triggered immediately after an LSP connection is
successfully initialized. This provides a way to perform any additional
initialization work, such as setting up buffer-level mappings.

View file

@ -187,6 +187,7 @@ formatting.
* [SyntaxErl](https://github.com/ten0s/syntaxerl)
* [dialyzer](http://erlang.org/doc/man/dialyzer.html) :floppy_disk:
* [elvis](https://github.com/inaka/elvis) :floppy_disk:
* [erlang_ls](https://github.com/erlang-ls/erlang_ls)
* [erlc](http://erlang.org/doc/man/erlc.html)
* [erlfmt](https://github.com/WhatsApp/erlfmt)
* Fish
@ -491,6 +492,7 @@ formatting.
* [pyre](https://github.com/facebook/pyre-check) :warning:
* [pyright](https://github.com/microsoft/pyright)
* [reorder-python-imports](https://github.com/asottile/reorder_python_imports)
* [ruff](https://github.com/charliermarsh/ruff)
* [unimport](https://github.com/hakancelik96/unimport)
* [vulture](https://github.com/jendrikseipp/vulture) :warning: :floppy_disk:
* [yapf](https://github.com/google/yapf)
@ -504,6 +506,7 @@ formatting.
* Racket
* [racket-langserver](https://github.com/jeapostrophe/racket-langserver/tree/master)
* [raco](https://docs.racket-lang.org/raco/)
* [raco_fmt](https://docs.racket-lang.org/fmt/)
* Re:VIEW
* [redpen](http://redpen.cc/)
* ReasonML

View file

@ -68,6 +68,8 @@ endif
" specification.
" https://github.com/nvim-treesitter/nvim-treesitter/blob/master/plugin/nvim-treesitter.vim
if exists('g:loaded_nvim_treesitter')
" deprecated TS* highlight groups
" see https://github.com/nvim-treesitter/nvim-treesitter/pull/3656
" # Misc
hi! link TSPunctSpecial Special
" # Constants
@ -97,6 +99,53 @@ if exists('g:loaded_nvim_treesitter')
" HTML and JSX tag attributes. By default, this group is linked to TSProperty,
" which in turn links to Identifer (white).
hi! link TSTagAttribute DraculaGreenItalic
if has('nvim-0.8')
" # Misc
hi! link @punctuation.delimiter Delimiter
hi! link @punctuation.bracket Normal
hi! link @punctuation.special Special
" # Constants
hi! link @constant Constant
hi! link @constant.builtin Constant
hi! link @constant.macro Macro
hi! link @string.regex String
hi! link @string.escape Character
hi! link @symbol DraculaPurple
hi! link @annotation DraculaYellow
hi! link @attribute DraculaGreenItalic
hi! link @namespace Structure
" # Functions
hi! link @function.builtin DraculaCyan
hi! link @funcion.macro Function
hi! link @parameter DraculaOrangeItalic
hi! link @parameter.reference DraculaOrange
hi! link @field DraculaOrange
hi! link @property Normal
hi! link @constructor DraculaCyan
" # Keywords
hi! link @label DraculaPurpleItalic
hi! link @keyword.function DraculaPink
hi! link @keyword.operator Operator
hi! link @exception DraculaPurple
" # Variable
hi! link @variable Normal
hi! link @variable.builtin DraculaPurpleItalic
" # Text
hi! link @text Normal
hi! link @text.strong DraculaFgBold
hi! link @text.emphasis DraculaFg
hi! link @text.underline Underlined
hi! link @text.title DraculaYellow
hi! link @text.literal DraculaYellow
hi! link @text.uri DraculaYellow
" # Tags
hi! link @tag DraculaCyan
hi! link @tag.delimiter Normal
" HTML and JSX tag attributes. By default, this group is linked to TSProperty,
" which in turn links to Identifer (white).
hi! link @tag.attribute DraculaGreenItalic
endif
endif
" }}}
" nvim-cmp: {{{

View file

@ -97,6 +97,10 @@ if !exists('g:dracula_colorterm')
let g:dracula_colorterm = 1
endif
if !exists('g:dracula_high_contrast_diff')
let g:dracula_high_contrast_diff = 0
endif
"}}}2
" Script Helpers: {{{2
@ -197,7 +201,12 @@ call s:h('DraculaBoundary', s:comment, s:bgdark)
call s:h('DraculaWinSeparator', s:comment, s:bgdark)
call s:h('DraculaLink', s:cyan, s:none, [s:attrs.underline])
if g:dracula_high_contrast_diff
call s:h('DraculaDiffChange', s:yellow, s:purple)
else
call s:h('DraculaDiffChange', s:orange, s:none)
endif
call s:h('DraculaDiffText', s:bg, s:orange)
call s:h('DraculaDiffDelete', s:red, s:bgdark)

View file

@ -93,6 +93,11 @@ terminal emulators, set to 1 to allow underline/undercurl highlights without
changing the foreground color. >
let g:dracula_full_special_attrs_support = 1
* *g:dracula_high_contrast_diff*
Use high-contrast color when in diff mode. By default it is disabled, set to
1 to enable it.
let g:dracula_high_contrast_diff = 1
* *g:dracula_inverse*
Include inverse attributes in highlighting >
let g:dracula_inverse = 1

View file

@ -60,23 +60,26 @@ lockvar s:SECTCRE s:OPTCRE s:MAX_SECTION_NAME s:MAX_PROPERTY_NAME s:MAX_PROPERTY
" Read \p config_filename and return the options applicable to
" \p target_filename. This is the main entry point in this file.
function! editorconfig_core#ini#read_ini_file(config_filename, target_filename)
let l:oldenc = &encoding
if !filereadable(a:config_filename)
return {}
endif
try " so &encoding will always be reset
let &encoding = 'utf-8' " so readfile() will strip BOM
try
let l:lines = readfile(a:config_filename)
if &encoding !=? 'utf-8'
" strip BOM
if len(l:lines) > 0 && l:lines[0][:2] ==# "\xEF\xBB\xBF"
let l:lines[0] = l:lines[0][3:]
endif
" convert from UTF-8 to 'encoding'
call map(l:lines, 'iconv(v:val, "utf-8", &encoding)')
endif
let result = s:parse(a:config_filename, a:target_filename, l:lines)
catch
let &encoding = l:oldenc
" rethrow, but with a prefix since throw 'Vim...' fails.
throw 'Could not read editorconfig file at ' . v:throwpoint . ': ' . string(v:exception)
endtry
let &encoding = l:oldenc
return result
endfunction

View file

@ -124,11 +124,11 @@ is restarted.
*g:EditorConfig_max_line_indicator*
The way to show the line where the maximal length is reached. Accepted values
are "line", "fill", otherwise there will be no max line indicator.
are "line", "fill" and "exceeding", otherwise there will be no max line
indicator.
"line": the right column of the max line length column will be
highlighted, made possible by setting 'colorcolumn' to
"max_line_length + 1".
highlighted, made possible by adding "+1" to 'colorcolumn'.
"fill": all the columns to the right of the max line length column
will be highlighted, made possible by setting 'colorcolumn'
@ -161,6 +161,23 @@ max_line_length is set:
<
This option defaults to 0.
*g:EditorConfig_softtabstop_space*
When spaces are used for indent, Vim's 'softtabstop' feature will make the
backspace key delete one indent level. If you turn off that feature (by
setting the option to 0), only a single space will be deleted.
This option defaults to 1, which enables 'softtabstop' and uses the
'shiftwidth' value for it. You can also set this to -1 to automatically follow
the current 'shiftwidth' value (since Vim 7.3.693). Or set this to [] if
EditorConfig should not touch 'softtabstop' at all.
*g:EditorConfig_softtabstop_tab*
When tabs are used for indent, Vim's 'softtabstop' feature only applies to
backspacing over existing runs of spaces.
This option defaults to 1, so backspace will delete one indent level worth of
spaces; -1 does the same but automatically follows the current 'shiftwidth'
value. Set this to 0 to have backspace delete just a single space character.
Or set this to [] if EditorConfig should not touch 'softtabstop' at all.
*g:EditorConfig_verbose*
Set this to 1 if you want debug info printed:
>

View file

@ -60,6 +60,14 @@ if !exists('g:EditorConfig_disable_rules')
let g:EditorConfig_disable_rules = []
endif
if !exists('g:EditorConfig_softtabstop_space')
let g:EditorConfig_softtabstop_space = 1
endif
if !exists('g:EditorConfig_softtabstop_tab')
let g:EditorConfig_softtabstop_tab = 1
endif
" Copy some of the globals into script variables --- changes to these
" globals won't affect the plugin until the plugin is reloaded.
if exists('g:EditorConfig_core_mode') && !empty(g:EditorConfig_core_mode)
@ -394,12 +402,18 @@ function! s:ApplyConfig(config) abort " Set the buffer options {{{1
" value
if a:config["indent_size"] == "tab"
let &l:shiftwidth = &l:tabstop
let &l:softtabstop = &l:shiftwidth
if type(g:EditorConfig_softtabstop_tab) != type([])
let &l:softtabstop = g:EditorConfig_softtabstop_tab > 0 ?
\ &l:shiftwidth : g:EditorConfig_softtabstop_tab
endif
else
let l:indent_size = str2nr(a:config["indent_size"])
if l:indent_size > 0
let &l:shiftwidth = l:indent_size
let &l:softtabstop = &l:shiftwidth
if type(g:EditorConfig_softtabstop_space) != type([])
let &l:softtabstop = g:EditorConfig_softtabstop_space > 0 ?
\ &l:shiftwidth : g:EditorConfig_softtabstop_space
endif
endif
endif
@ -473,7 +487,7 @@ function! s:ApplyConfig(config) abort " Set the buffer options {{{1
if exists('+colorcolumn')
if l:max_line_length > 0
if g:EditorConfig_max_line_indicator == 'line'
let &l:colorcolumn = l:max_line_length + 1
setlocal colorcolumn+=+1
elseif g:EditorConfig_max_line_indicator == 'fill' &&
\ l:max_line_length < &l:columns
" Fill only if the columns of screen is large enough

View file

@ -160,3 +160,10 @@ if extcore
)
test_instance vim
end
# Test the vim core with latin1 encoding
(lambda do
puts 'Testing with express vim_core mode'
vim = create_vim("set encoding=latin1")
test_instance vim
end).call

View file

@ -1940,7 +1940,7 @@ syn keyword ngxDirectiveThirdParty srcache_default_expire
syn keyword ngxDirectiveThirdParty srcache_max_expire
" SSSD Info Module <https://github.com/veruu/ngx_sssd_info>
" Retrieves additional attributes from SSSD for current authentizated user
" Retrives additional attributes from SSSD for current authentizated user
syn keyword ngxDirectiveThirdParty sssd_info
syn keyword ngxDirectiveThirdParty sssd_info_output_to
syn keyword ngxDirectiveThirdParty sssd_info_groups

View file

@ -18,7 +18,7 @@ function! s:strip_white_space(l,r,line) abort
if l[-1:] ==# ' ' && stridx(a:line,l) == -1 && stridx(a:line,l[0:-2]) == 0
let l = l[:-2]
endif
if r[0] ==# ' ' && a:line[-strlen(r):] != r && a:line[1-strlen(r):] == r[1:]
if r[0] ==# ' ' && (' ' . a:line)[-strlen(r)-1:] != r && a:line[-strlen(r):] == r[1:]
let r = r[1:]
endif
return [l, r]

View file

@ -470,7 +470,7 @@ function! s:GitCmd() abort
let string = strpart(string, len(arg))
let arg = substitute(arg, '^\s\+', '', '')
let arg = substitute(arg,
\ '\(' . dquote . '''\%(''''\|[^'']\)*''\|\\[' . s:fnameescape . ']\|^\\[>+-]\|!\d*\)\|' . s:expand,
\ '\(' . dquote . '''\%(''''\|[^'']\)*''\|\\[' . s:fnameescape . ']\|^\\[>+-]\|' . s:commit_expand . '\)\|' . s:expand,
\ '\=submatch(0)[0] ==# "\\" ? submatch(0)[1] : submatch(0)[1:-2]', 'g')
call add(list, arg)
endwhile
@ -1958,6 +1958,7 @@ endfunction
let s:var = '\%(<\%(cword\|cWORD\|cexpr\|cfile\|sfile\|slnum\|afile\|abuf\|amatch' . (has('clientserver') ? '\|client' : '') . '\)>\|%\|#<\=\d\+\|##\=\)'
let s:flag = '\%(:[p8~.htre]\|:g\=s\(.\).\{-\}\1.\{-\}\1\)'
let s:expand = '\%(\(' . s:var . '\)\(' . s:flag . '*\)\(:S\)\=\)'
let s:commit_expand = '!\\\@!#\=\d*\|!%'
function! s:BufName(var) abort
if a:var ==# '%'
@ -1978,8 +1979,8 @@ function! s:ExpandVar(other, var, flags, esc, ...) abort
return substitute(a:other[1:-2], "''", "'", "g")
elseif a:other =~# '^"'
return substitute(a:other[1:-2], '""', '"', "g")
elseif a:other =~# '^!'
let buffer = s:BufName(len(a:other) > 1 ? '#'. a:other[1:-1] : '%')
elseif a:other =~# '^[!`]'
let buffer = s:BufName(a:other =~# '[0-9#]' ? '#' . matchstr(a:other, '\d\+') : '%')
let owner = s:Owner(buffer)
return len(owner) ? owner : '@'
elseif a:other =~# '^\~[~.]$'
@ -2033,7 +2034,11 @@ function! s:ExpandVar(other, var, flags, esc, ...) abort
return join(files, "\1")
endfunction
if has('win32')
let s:fnameescape = " \t\n*?`%#'\"|!<"
else
let s:fnameescape = " \t\n*?[{`$\\%#'\"|!<"
endif
function! s:Expand(rev, ...) abort
if a:rev =~# '^>' && s:Slash(@%) =~# '^fugitive://' && empty(s:DirCommitFile(@%)[1])
@ -2060,13 +2065,13 @@ function! s:Expand(rev, ...) abort
let file = a:rev
endif
return substitute(file,
\ '\(\\[' . s:fnameescape . ']\|^\\[>+-]\|!\d*\|^\~[~.]\)\|' . s:expand,
\ '\(\\[' . s:fnameescape . ']\|^\\[>+-]\|' . s:commit_expand . '\|^\~[~.]\)\|' . s:expand,
\ '\=tr(s:ExpandVar(submatch(1),submatch(2),submatch(3),"", a:0 ? a:1 : getcwd()), "\1", " ")', 'g')
endfunction
function! fugitive#Expand(object) abort
return substitute(a:object,
\ '\(\\[' . s:fnameescape . ']\|^\\[>+-]\|!\d*\|^\~[~.]\)\|' . s:expand,
\ '\(\\[' . s:fnameescape . ']\|^\\[>+-]\|' . s:commit_expand . '\|^\~[~.]\)\|' . s:expand,
\ '\=tr(s:ExpandVar(submatch(1),submatch(2),submatch(3),submatch(5)), "\1", " ")', 'g')
endfunction
@ -2087,7 +2092,7 @@ function! s:SplitExpandChain(string, ...) abort
\ '\=s:DotRelative(s:Slash(simplify(getcwd() . "/" . submatch(0))), cwd)', '')
endif
let arg = substitute(arg,
\ '\(' . dquote . '''\%(''''\|[^'']\)*''\|\\[' . s:fnameescape . ']\|^\\[>+-]\|!\d*\|^\~[~]\|^\~\w*\|\$\w\+\)\|' . s:expand,
\ '\(' . dquote . '''\%(''''\|[^'']\)*''\|\\[' . s:fnameescape . ']\|^\\[>+-]\|' . s:commit_expand . '\|^\~[~]\|^\~\w*\|\$\w\+\)\|' . s:expand,
\ '\=s:ExpandVar(submatch(1),submatch(2),submatch(3),submatch(5), cwd)', 'g')
call extend(list, split(arg, "\1", 1))
if arg ==# '--'

View file

@ -70,12 +70,10 @@ that are part of Git repositories).
O jump to patch or blob in new tab
p jump to patch or blob in preview window
- reblame at commit
~ reblame at commit~[count]
P reblame at commit^[count]
*g:fugitive_dynamic_colors*
In the GUI or a 256 color terminal, commit hashes will
highlighted in different colors. To disable this:
be highlighted in different colors. To disable this:
>
let g:fugitive_dynamic_colors = 0
<

View file

@ -140,7 +140,7 @@ function! FugitiveExecute(args, ...) abort
return call('fugitive#Execute', [a:args] + a:000)
endfunction
" FugitiveShellCommand() turns an array of arugments into a Git command string
" FugitiveShellCommand() turns an array of arguments into a Git command string
" which can be executed with functions like system() and commands like :!.
" Integer arguments will be treated as buffer numbers, and the appropriate
" relative path inserted in their place.

View file

@ -501,18 +501,15 @@ endfunction
" Floating window: does not care where cursor is.
" Preview window: assumes cursor is in preview window.
function! s:populate_hunk_preview_window(header, body)
let body_length = len(a:body)
if g:gitgutter_preview_win_floating
if exists('*nvim_open_win')
let height = min([body_length, g:gitgutter_floating_window_options.height])
" Assumes cursor is not in previewing window.
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, height] = s:screen_lines(a:body)
let height = min([height, g:gitgutter_floating_window_options.height])
call nvim_win_set_width(s:winid, width)
call nvim_win_set_height(s:winid, height)
@ -548,9 +545,7 @@ function! s:populate_hunk_preview_window(header, body)
call setline(1, a:body)
setlocal nomodified
normal! G$
let hunk_height = max([body_length, winline()])
let height = min([hunk_height, &previewheight])
let [_, height] = s:screen_lines(a:body)
execute 'resize' height
1
@ -565,6 +560,27 @@ function! s:populate_hunk_preview_window(header, body)
endfunction
" Calculates the number of columns and the number of screen lines the given
" array of lines will take up, taking account of wrapping.
function! s:screen_lines(lines)
let [_virtualedit, &virtualedit]=[&virtualedit, 'all']
let cursor = getcurpos()
normal! g$
let available_width = virtcol('.')
call setpos('.', cursor)
let &virtualedit=_virtualedit
let width = min([max(map(copy(a:lines), 'strdisplaywidth(v:val)')), available_width])
if exists('*reduce')
let height = reduce(a:lines, { acc, val -> acc + strdisplaywidth(val) / width + (strdisplaywidth(val) % width == 0 ? 0 : 1) }, 0)
else
let height = eval(join(map(copy(a:lines), 'strdisplaywidth(v:val) / width + (strdisplaywidth(v:val) % width == 0 ? 0 : 1)'), '+'))
endif
return [width, height]
endfunction
function! s:enable_staging_from_hunk_preview_window()
augroup gitgutter_hunk_preview
autocmd!

View file

@ -546,7 +546,7 @@ function! s:TableFormat()
let l:flags = (&gdefault ? '' : 'g')
execute 's/\(:\@<!-:\@!\|[^|:-]\)//e' . l:flags
execute 's/--/-/e' . l:flags
Tabularize /|
Tabularize /\(\\\)\@<!|
" Move colons for alignment to left or right side of the cell.
execute 's/:\( \+\)|/\1:|/e' . l:flags
execute 's/|\( \+\):/|:\1/e' . l:flags

View file

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

View file

@ -70,6 +70,13 @@ support:
git clone https://tpope.io/vim/surround.git
vim -u NONE -c "helptags surround/doc" -c q
## FAQ
> How do I surround without adding a space?
Only the opening brackets—`[`, `{`, and `(`—add a space. Use a closing
bracket, or the `b` (`(`) and `B` (`{`) aliases.
## Contributing
See the contribution guidelines for