mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:5477506a9f01
Update runtime files.5477506a9f
NA: vim-patch:2a9c9f6d89f1 "undo extra changes in src/Makefile"2a9c9f6d89
This commit is contained in:
parent
7c19a4e518
commit
9bc4f275b3
@ -1,8 +1,8 @@
|
|||||||
" Vim compiler file
|
" Vim compiler file
|
||||||
" Compiler: Microsoft Visual Studio C#
|
" Compiler: Microsoft Visual Studio C#
|
||||||
" Maintainer: Zhou YiChao (broken.zhou@gmail.com)
|
" Maintainer: Yichao Zhou (broken.zhou@gmail.com)
|
||||||
" Previous Maintainer: Joseph H. Yao (hyao@sina.com)
|
" Previous Maintainer: Joseph H. Yao (hyao@sina.com)
|
||||||
" Last Change: 2012 Apr 30
|
" Last Change: Jul 22, 2019
|
||||||
|
|
||||||
if exists("current_compiler")
|
if exists("current_compiler")
|
||||||
finish
|
finish
|
||||||
@ -20,7 +20,7 @@ CompilerSet errorformat+=%f(%l\\,%v):\ %t%*[^:]:\ %m,
|
|||||||
\%trror%*[^:]:\ %m,
|
\%trror%*[^:]:\ %m,
|
||||||
\%tarning%*[^:]:\ %m
|
\%tarning%*[^:]:\ %m
|
||||||
|
|
||||||
CompilerSet makeprg=csc\ %
|
CompilerSet makeprg=csc\ %:S
|
||||||
|
|
||||||
let &cpo = s:keepcpo
|
let &cpo = s:keepcpo
|
||||||
unlet s:keepcpo
|
unlet s:keepcpo
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
" Vim compiler file
|
" Vim compiler file
|
||||||
" Compiler: Erlang
|
" Compiler: Erlang
|
||||||
" Maintainer: Dmitry Vasiliev <dima at hlabs dot org>
|
" Maintainer: Dmitry Vasiliev <dima at hlabs dot org>
|
||||||
" Last Change: 2012-02-13
|
" Last Change: 2019 Jul 23
|
||||||
|
|
||||||
if exists("current_compiler")
|
if exists("current_compiler")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let current_compiler = "erlang"
|
let current_compiler = "erlang"
|
||||||
|
|
||||||
CompilerSet makeprg=erlc\ -Wall\ %
|
CompilerSet makeprg=erlc\ -Wall\ %:S
|
||||||
|
|
||||||
CompilerSet errorformat=%f:%l:\ %m
|
CompilerSet errorformat=%f:%l:\ %m
|
||||||
|
@ -22,7 +22,7 @@ CompilerSet errorformat=
|
|||||||
\%-Z%p%^%.%#,
|
\%-Z%p%^%.%#,
|
||||||
\%-G%.%#,
|
\%-G%.%#,
|
||||||
" Compiler call
|
" Compiler call
|
||||||
CompilerSet makeprg=df\ /nologo\ /noobj\ /c\ %
|
CompilerSet makeprg=df\ /nologo\ /noobj\ /c\ %:S
|
||||||
" Visual fortran defaults to printing output on stderr
|
" Visual fortran defaults to printing output on stderr
|
||||||
" Adjust option shellpipe accordingly
|
" Adjust option shellpipe accordingly
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Vim Compiler File
|
" Vim Compiler File
|
||||||
" Compiler: Jikes
|
" Compiler: Jikes
|
||||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||||
" Last Change: 20 Jan 2009
|
" Last Change: 2019 Jul 23
|
||||||
" URL: http://dwsharp.users.sourceforge.net/vim/compiler
|
" URL: http://dwsharp.users.sourceforge.net/vim/compiler
|
||||||
|
|
||||||
if exists("current_compiler")
|
if exists("current_compiler")
|
||||||
@ -14,5 +14,5 @@ if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Jikes defaults to printing output on stderr
|
" Jikes defaults to printing output on stderr
|
||||||
CompilerSet makeprg=jikes\ -Xstdout\ +E\ \"%\"
|
CompilerSet makeprg=jikes\ -Xstdout\ +E\ \"%:S\"
|
||||||
CompilerSet errorformat=%f:%l:%v:%*\\d:%*\\d:%*\\s%m
|
CompilerSet errorformat=%f:%l:%v:%*\\d:%*\\d:%*\\s%m
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Vim compiler file
|
" Vim compiler file
|
||||||
" Compiler: onsgmls
|
" Compiler: onsgmls
|
||||||
" Maintainer: Robert Rowsome <rowsome@wam.umd.edu>
|
" Maintainer: Robert Rowsome <rowsome@wam.umd.edu>
|
||||||
" Last Change: 2004 Mar 27
|
" Last Change: 2019 Jul 23
|
||||||
|
|
||||||
if exists("current_compiler")
|
if exists("current_compiler")
|
||||||
finish
|
finish
|
||||||
@ -15,7 +15,7 @@ endif
|
|||||||
let s:cpo_save = &cpo
|
let s:cpo_save = &cpo
|
||||||
set cpo-=C
|
set cpo-=C
|
||||||
|
|
||||||
CompilerSet makeprg=onsgmls\ -s\ %
|
CompilerSet makeprg=onsgmls\ -s\ %:S
|
||||||
|
|
||||||
CompilerSet errorformat=onsgmls:%f:%l:%c:%t:%m,
|
CompilerSet errorformat=onsgmls:%f:%l:%c:%t:%m,
|
||||||
\onsgmls:%f:%l:%c:%m
|
\onsgmls:%f:%l:%c:%m
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Vim Compiler File
|
" Vim Compiler File
|
||||||
" Compiler: Perl syntax checks (perl -Wc)
|
" Compiler: Perl syntax checks (perl -Wc)
|
||||||
" Maintainer: Christian J. Robinson <heptite@gmail.com>
|
" Maintainer: Christian J. Robinson <heptite@gmail.com>
|
||||||
" Last Change: 2006 Aug 13
|
" Last Change: 2019 Jul 22
|
||||||
|
|
||||||
if exists("current_compiler")
|
if exists("current_compiler")
|
||||||
finish
|
finish
|
||||||
@ -27,7 +27,7 @@ else
|
|||||||
let s:taintopt = ''
|
let s:taintopt = ''
|
||||||
endif
|
endif
|
||||||
|
|
||||||
exe 'CompilerSet makeprg=perl\ -' . s:warnopt . s:taintopt . 'c\ %'
|
exe 'CompilerSet makeprg=perl\ -' . s:warnopt . s:taintopt . 'c\ %:S'
|
||||||
|
|
||||||
CompilerSet errorformat=
|
CompilerSet errorformat=
|
||||||
\%-G%.%#had\ compilation\ errors.,
|
\%-G%.%#had\ compilation\ errors.,
|
||||||
|
@ -19,7 +19,7 @@ endif
|
|||||||
if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent != 0
|
if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent != 0
|
||||||
CompilerSet makeprg=rustc
|
CompilerSet makeprg=rustc
|
||||||
else
|
else
|
||||||
CompilerSet makeprg=rustc\ \%
|
CompilerSet makeprg=rustc\ \%:S
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Old errorformat (before nightly 2016/08/10)
|
" Old errorformat (before nightly 2016/08/10)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
" Compiler: splint/lclint (C source code checker)
|
" Compiler: splint/lclint (C source code checker)
|
||||||
" Maintainer: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
|
" Maintainer: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
|
||||||
" Splint Home: http://www.splint.org/
|
" Splint Home: http://www.splint.org/
|
||||||
" Last Change: 2005 Apr 21
|
" Last Change: 2019 Jul 23
|
||||||
" $Revision: 1.3 $
|
" $Revision: 1.3 $
|
||||||
|
|
||||||
if exists("current_compiler")
|
if exists("current_compiler")
|
||||||
@ -19,7 +19,7 @@ set cpo-=C
|
|||||||
|
|
||||||
" adapt this if you want to check more than one file at a time.
|
" adapt this if you want to check more than one file at a time.
|
||||||
" put command line options in .splintrc or ~/.splintrc
|
" put command line options in .splintrc or ~/.splintrc
|
||||||
CompilerSet makeprg=splint\ %
|
CompilerSet makeprg=splint\ %:S
|
||||||
|
|
||||||
" Note: when using the new array bounds checking flags: Each warning
|
" Note: when using the new array bounds checking flags: Each warning
|
||||||
" usually has several lines and several references to source code mostly
|
" usually has several lines and several references to source code mostly
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Vim Compiler File
|
" Vim Compiler File
|
||||||
" Compiler: xmlwf
|
" Compiler: xmlwf
|
||||||
" Maintainer: Robert Rowsome <rowsome@wam.umd.edu>
|
" Maintainer: Robert Rowsome <rowsome@wam.umd.edu>
|
||||||
" Last Change: 2004 Mar 27
|
" Last Change: 2019 Jul 23
|
||||||
|
|
||||||
if exists("current_compiler")
|
if exists("current_compiler")
|
||||||
finish
|
finish
|
||||||
@ -15,7 +15,7 @@ if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
|||||||
command -nargs=* CompilerSet setlocal <args>
|
command -nargs=* CompilerSet setlocal <args>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CompilerSet makeprg=xmlwf\ %
|
CompilerSet makeprg=xmlwf\ %:S
|
||||||
|
|
||||||
CompilerSet errorformat=%f:%l%c:%m
|
CompilerSet errorformat=%f:%l%c:%m
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ After setting this variable, reload the syntax script: >
|
|||||||
FINDING THE DIFFERENCES *diff-diffexpr*
|
FINDING THE DIFFERENCES *diff-diffexpr*
|
||||||
|
|
||||||
The 'diffexpr' option can be set to use something else than the standard
|
The 'diffexpr' option can be set to use something else than the standard
|
||||||
"diff" program to compare two files and find the differences.
|
"diff" program to compare two files and find the differences. *E959*
|
||||||
|
|
||||||
When 'diffexpr' is empty, Vim uses this command to find the differences
|
When 'diffexpr' is empty, Vim uses this command to find the differences
|
||||||
between file1 and file2: >
|
between file1 and file2: >
|
||||||
|
@ -1589,7 +1589,7 @@ v:exception The value of the exception most recently caught and not
|
|||||||
:try
|
:try
|
||||||
: throw "oops"
|
: throw "oops"
|
||||||
:catch /.*/
|
:catch /.*/
|
||||||
: echo "caught" v:exception
|
: echo "caught " .. v:exception
|
||||||
:endtry
|
:endtry
|
||||||
< Output: "caught oops".
|
< Output: "caught oops".
|
||||||
|
|
||||||
@ -3983,7 +3983,10 @@ get({list}, {idx} [, {default}]) *get()*
|
|||||||
get({dict}, {key} [, {default}])
|
get({dict}, {key} [, {default}])
|
||||||
Get item with key {key} from |Dictionary| {dict}. When this
|
Get item with key {key} from |Dictionary| {dict}. When this
|
||||||
item is not available return {default}. Return zero when
|
item is not available return {default}. Return zero when
|
||||||
{default} is omitted.
|
{default} is omitted. Useful example: >
|
||||||
|
let val = get(g:, 'var_name', 'default')
|
||||||
|
< This gets the value of g:var_name if it exists, and uses
|
||||||
|
'default' when it does not exist.
|
||||||
get({func}, {what})
|
get({func}, {what})
|
||||||
Get item {what} from Funcref {func}. Possible values for
|
Get item {what} from Funcref {func}. Possible values for
|
||||||
{what} are:
|
{what} are:
|
||||||
@ -6645,7 +6648,8 @@ remove({list}, {idx} [, {end}]) *remove()*
|
|||||||
:echo "last item: " . remove(mylist, -1)
|
:echo "last item: " . remove(mylist, -1)
|
||||||
:call remove(mylist, 0, 9)
|
:call remove(mylist, 0, 9)
|
||||||
remove({dict}, {key})
|
remove({dict}, {key})
|
||||||
Remove the entry from {dict} with key {key}. Example: >
|
Remove the entry from {dict} with key {key} and return it.
|
||||||
|
Example: >
|
||||||
:echo "removed " . remove(dict, "one")
|
:echo "removed " . remove(dict, "one")
|
||||||
< If there is no {key} in {dict} this is an error.
|
< If there is no {key} in {dict} this is an error.
|
||||||
|
|
||||||
|
@ -189,16 +189,16 @@ To see the LuaJIT version: >
|
|||||||
:lua print(jit.version)
|
:lua print(jit.version)
|
||||||
<
|
<
|
||||||
|
|
||||||
:[range]lua << {endmarker}
|
:[range]lua << [endmarker]
|
||||||
{script}
|
{script}
|
||||||
{endmarker}
|
{endmarker}
|
||||||
Execute Lua script {script}.
|
Execute Lua script {script}. Useful for including Lua
|
||||||
|
code in Vim scripts.
|
||||||
|
|
||||||
{endmarker} must NOT be preceded by any white space. If {endmarker} is
|
The {endmarker} must NOT be preceded by any white space.
|
||||||
omitted from after the "<<", a dot '.' must be used after {script}, like
|
|
||||||
for the |:append| and |:insert| commands.
|
If [endmarker] is omitted from after the "<<", a dot '.' must be used after
|
||||||
This form of the |:lua| command is mainly useful for including Lua code
|
{script}, like for the |:append| and |:insert| commands.
|
||||||
in Vim scripts.
|
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
>
|
>
|
||||||
|
@ -19,18 +19,17 @@ Commands *python-commands*
|
|||||||
the `:python` command is working: >
|
the `:python` command is working: >
|
||||||
:python print "Hello"
|
:python print "Hello"
|
||||||
|
|
||||||
:[range]py[thon] << {endmarker}
|
:[range]py[thon] << [endmarker]
|
||||||
{script}
|
{script}
|
||||||
{endmarker}
|
{endmarker}
|
||||||
Execute Python script {script}.
|
Execute Python script {script}. Useful for including
|
||||||
Note: This command doesn't work when Python isn't
|
python code in Vim scripts. Requires Python, see
|
||||||
available. To avoid errors, see |script-here|.
|
|script-here|.
|
||||||
|
|
||||||
{endmarker} must NOT be preceded by any white space. If {endmarker} is
|
The {endmarker} below the {script} must NOT be preceded by any white space.
|
||||||
omitted from after the "<<", a dot '.' must be used after {script}, like
|
|
||||||
for the |:append| and |:insert| commands.
|
If [endmarker] is omitted from after the "<<", a dot '.' must be used after
|
||||||
This form of the |:python| command is mainly useful for including python code
|
{script}, like for the |:append| and |:insert| commands.
|
||||||
in Vim scripts.
|
|
||||||
|
|
||||||
Example: >
|
Example: >
|
||||||
function! IcecreamInitialize()
|
function! IcecreamInitialize()
|
||||||
|
@ -19,15 +19,19 @@ downloading Ruby there.
|
|||||||
:rub[y] {cmd} Execute Ruby command {cmd}. A command to try it out: >
|
:rub[y] {cmd} Execute Ruby command {cmd}. A command to try it out: >
|
||||||
:ruby print "Hello"
|
:ruby print "Hello"
|
||||||
|
|
||||||
:rub[y] << {endpattern}
|
:rub[y] << [endpattern]
|
||||||
{script}
|
{script}
|
||||||
{endpattern}
|
{endpattern}
|
||||||
Execute Ruby script {script}.
|
Execute Ruby script {script}.
|
||||||
{endpattern} must NOT be preceded by any white space.
|
The {endpattern} after {script} must NOT be preceded
|
||||||
If {endpattern} is omitted, it defaults to a dot '.'
|
by any white space.
|
||||||
like for the |:append| and |:insert| commands. This
|
|
||||||
form of the |:ruby| command is mainly useful for
|
If [endpattern] is omitted, it defaults to a dot '.'
|
||||||
|
like for the |:append| and |:insert| commands.
|
||||||
|
|
||||||
|
This form of the |:ruby| command is mainly useful for
|
||||||
including ruby code in vim scripts.
|
including ruby code in vim scripts.
|
||||||
|
|
||||||
Note: This command doesn't work when the Ruby feature
|
Note: This command doesn't work when the Ruby feature
|
||||||
wasn't compiled in. To avoid errors, see
|
wasn't compiled in. To avoid errors, see
|
||||||
|script-here|.
|
|script-here|.
|
||||||
|
@ -827,7 +827,7 @@ PHP indenting can be altered in several ways by modifying the values of some
|
|||||||
global variables:
|
global variables:
|
||||||
|
|
||||||
*php-comment* *PHP_autoformatcomment*
|
*php-comment* *PHP_autoformatcomment*
|
||||||
To not enable auto-formatting of comments by default (if you want to use your
|
To not enable auto-formating of comments by default (if you want to use your
|
||||||
own 'formatoptions'): >
|
own 'formatoptions'): >
|
||||||
:let g:PHP_autoformatcomment = 0
|
:let g:PHP_autoformatcomment = 0
|
||||||
|
|
||||||
@ -924,6 +924,41 @@ You will obtain the following result: >
|
|||||||
->age()
|
->age()
|
||||||
->info();
|
->info();
|
||||||
|
|
||||||
|
-------------
|
||||||
|
|
||||||
|
*PHP_IndentFunctionCallParameters*
|
||||||
|
Extra indentation levels to add to parameters in multi-line function calls. >
|
||||||
|
let g:PHP_IndentFunctionCallParameters = 1
|
||||||
|
|
||||||
|
Function call arguments will indent 1 extra level. For two-space indentation: >
|
||||||
|
|
||||||
|
function call_the_thing(
|
||||||
|
$with_this,
|
||||||
|
$and_that
|
||||||
|
) {
|
||||||
|
$this->do_the_thing(
|
||||||
|
$with_this,
|
||||||
|
$and_that
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
-------------
|
||||||
|
|
||||||
|
*PHP_IndentFunctionDeclarationParameters*
|
||||||
|
Extra indentation levels to add to arguments in multi-line function definitions. >
|
||||||
|
let g:PHP_IndentFunctionDeclarationParameters = 1
|
||||||
|
|
||||||
|
Function arguments in declarations will indent 1 extra level. For two-space indentation: >
|
||||||
|
|
||||||
|
function call_the_thing(
|
||||||
|
$with_this,
|
||||||
|
$and_that
|
||||||
|
) {
|
||||||
|
$this->do_the_thing(
|
||||||
|
$with_this,
|
||||||
|
$and_that
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
PYTHON *ft-python-indent*
|
PYTHON *ft-python-indent*
|
||||||
|
@ -676,7 +676,7 @@ After doing this once, Nvim sets the $VIMRUNTIME environment variable.
|
|||||||
In case you need the value of $VIMRUNTIME in a shell (e.g., for a script that
|
In case you need the value of $VIMRUNTIME in a shell (e.g., for a script that
|
||||||
greps in the help files) you might be able to use this: >
|
greps in the help files) you might be able to use this: >
|
||||||
|
|
||||||
VIMRUNTIME="$(nvim -e --cmd 'echo $VIMRUNTIME|quit' 2>&1)"
|
VIMRUNTIME="$(nvim --clean --headless --cmd 'echo $VIMRUNTIME|q')"
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
4. Suspending *suspend*
|
4. Suspending *suspend*
|
||||||
|
@ -138,6 +138,10 @@ CTRL-W CTRL-S *CTRL-W_CTRL-S*
|
|||||||
Note: CTRL-S does not work on all terminals and might block
|
Note: CTRL-S does not work on all terminals and might block
|
||||||
further input, use CTRL-Q to get going again.
|
further input, use CTRL-Q to get going again.
|
||||||
Also see |++opt| and |+cmd|.
|
Also see |++opt| and |+cmd|.
|
||||||
|
*E242*
|
||||||
|
Be careful when splitting a window in an autocommand, it may
|
||||||
|
mess up the window layout if this happens while making other
|
||||||
|
window layout changes.
|
||||||
|
|
||||||
CTRL-W CTRL-V *CTRL-W_CTRL-V*
|
CTRL-W CTRL-V *CTRL-W_CTRL-V*
|
||||||
CTRL-W v *CTRL-W_v*
|
CTRL-W v *CTRL-W_v*
|
||||||
@ -635,6 +639,8 @@ can also get to them with the buffer list commands, like ":bnext".
|
|||||||
|:vertical| was prepended).
|
|:vertical| was prepended).
|
||||||
Buf/Win Enter/Leave autocommands are not executed for the new
|
Buf/Win Enter/Leave autocommands are not executed for the new
|
||||||
windows here, that's only done when they are really entered.
|
windows here, that's only done when they are really entered.
|
||||||
|
If autocommands change the window layout while this command is
|
||||||
|
busy an error will be given. *E249*
|
||||||
|
|
||||||
:[N]sa[rgument][!] [++opt] [+cmd] [N] *:sa* *:sargument*
|
:[N]sa[rgument][!] [++opt] [+cmd] [N] *:sa* *:sargument*
|
||||||
Short for ":split | argument [N]": split window and go to Nth
|
Short for ":split | argument [N]": split window and go to Nth
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
" Vim indent file
|
" Vim indent file
|
||||||
" Language: PHP
|
" Language: PHP
|
||||||
" Author: John Wellesz <John.wellesz (AT) teaser (DOT) fr>
|
" Author: John Wellesz <John.wellesz (AT) gmail (DOT) com>
|
||||||
" URL: http://www.2072productions.com/vim/indent/php.vim
|
" URL: https://www.2072productions.com/vim/indent/php.vim
|
||||||
" Home: https://github.com/2072/PHP-Indenting-for-VIm
|
" Home: https://github.com/2072/PHP-Indenting-for-VIm
|
||||||
" Last Change: 2018 May 18th
|
" Last Change: 2019 Jully 21st
|
||||||
" Version: 1.66
|
" Version: 1.70
|
||||||
"
|
"
|
||||||
"
|
"
|
||||||
" Type :help php-indent for available options
|
" Type :help php-indent for available options
|
||||||
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
" NOTE: This script must be used with PHP syntax ON and with the php syntax
|
" NOTE: This script must be used with PHP syntax ON and with the php syntax
|
||||||
" script by Lutz Eymers (http://www.isp.de/data/php.vim ) or with the
|
" script by Lutz Eymers (http://www.isp.de/data/php.vim ) or with the
|
||||||
" script by Peter Hodge (http://www.vim.org/scripts/script.php?script_id=1571 )
|
" script by Peter Hodge (https://www.vim.org/scripts/script.php?script_id=1571 )
|
||||||
" the later is bunbdled by default with Vim 7.
|
" the later is bunbdled by default with Vim 7.
|
||||||
"
|
"
|
||||||
"
|
"
|
||||||
@ -41,7 +41,6 @@
|
|||||||
" silently remove them when VIM load this script (at each bufread).
|
" silently remove them when VIM load this script (at each bufread).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if exists("b:did_indent")
|
if exists("b:did_indent")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
@ -95,7 +94,17 @@ else
|
|||||||
let b:PHP_vintage_case_default_indent = 0
|
let b:PHP_vintage_case_default_indent = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if exists("PHP_IndentFunctionCallParameters")
|
||||||
|
let b:PHP_IndentFunctionCallParameters = PHP_IndentFunctionCallParameters
|
||||||
|
else
|
||||||
|
let b:PHP_IndentFunctionCallParameters = 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
if exists("PHP_IndentFunctionDeclarationParameters")
|
||||||
|
let b:PHP_IndentFunctionDeclarationParameters = PHP_IndentFunctionDeclarationParameters
|
||||||
|
else
|
||||||
|
let b:PHP_IndentFunctionDeclarationParameters = 0
|
||||||
|
endif
|
||||||
|
|
||||||
let b:PHP_lastindented = 0
|
let b:PHP_lastindented = 0
|
||||||
let b:PHP_indentbeforelast = 0
|
let b:PHP_indentbeforelast = 0
|
||||||
@ -129,15 +138,19 @@ endif
|
|||||||
|
|
||||||
if exists("*GetPhpIndent")
|
if exists("*GetPhpIndent")
|
||||||
call ResetPhpOptions()
|
call ResetPhpOptions()
|
||||||
finish
|
finish " XXX -- comment this line for easy dev
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
let s:PHP_validVariable = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
|
|
||||||
let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\|die\|else\)'
|
|
||||||
let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|\%(}\s*\)\?else\>\|do\>\|while\>\|switch\>\|case\>\|default\>\|for\%(each\)\=\>\|declare\>\|class\>\|trait\>\|use\>\|interface\>\|abstract\>\|final\>\|try\>\|\%(}\s*\)\=catch\>\|\%(}\s*\)\=finally\>\)'
|
|
||||||
let s:functionDecl = '\<function\>\%(\s\+&\='.s:PHP_validVariable.'\)\=\s*(.*'
|
|
||||||
let s:endline = '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$'
|
let s:endline = '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$'
|
||||||
|
let s:PHP_validVariable = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
|
||||||
|
let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\|die\|else\|end\%(if\|while\|for\|foreach\|switch\)\)'
|
||||||
|
let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|\%(}\s*\)\?else\>\|do\>\|while\>\|switch\>\|case\>\|default\>\|for\%(each\)\=\>\|declare\>\|class\>\|trait\>\|\%()\s*\)\=use\>\|interface\>\|abstract\>\|final\>\|try\>\|\%(}\s*\)\=catch\>\|\%(}\s*\)\=finally\>\)'
|
||||||
|
let s:functionDeclPrefix = '\<function\>\%(\s\+&\='.s:PHP_validVariable.'\)\=\s*('
|
||||||
|
let s:functionDecl = s:functionDeclPrefix.'.*'
|
||||||
|
let s:multilineFunctionDecl = s:functionDeclPrefix.s:endline
|
||||||
|
let s:arrayDecl = '\<array\>\s*(.*'
|
||||||
|
let s:multilineFunctionCall = s:PHP_validVariable.'\s*('.s:endline
|
||||||
let s:unstated = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.s:endline
|
let s:unstated = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.s:endline
|
||||||
|
|
||||||
|
|
||||||
@ -210,7 +223,7 @@ function! GetLastRealCodeLNum(startline) " {{{
|
|||||||
while getline(lnum) !~? tofind && lnum > 1
|
while getline(lnum) !~? tofind && lnum > 1
|
||||||
let lnum = lnum - 1
|
let lnum = lnum - 1
|
||||||
endwhile
|
endwhile
|
||||||
elseif lastline =~ '^[^''"`]*[''"`][;,]'.s:endline
|
elseif lastline =~ '^\s*[''"`][;,]' || (lastline =~ '^[^''"`]*[''"`][;,]'.s:endline && IslinePHP(lnum, "") == "SpecStringEntrails")
|
||||||
|
|
||||||
let tofind=substitute( lastline, '^.*\([''"`]\)[;,].*$', '^[^\1]\\+[\1]$\\|^[^\1]\\+[=([]\\s*[\1]', '')
|
let tofind=substitute( lastline, '^.*\([''"`]\)[;,].*$', '^[^\1]\\+[\1]$\\|^[^\1]\\+[=([]\\s*[\1]', '')
|
||||||
let trylnum = lnum
|
let trylnum = lnum
|
||||||
@ -289,17 +302,23 @@ function! FindOpenBracket(lnum, blockStarter) " {{{
|
|||||||
endfun " }}}
|
endfun " }}}
|
||||||
|
|
||||||
let s:blockChars = {'{':1, '[': 1, '(': 1, ')':-1, ']':-1, '}':-1}
|
let s:blockChars = {'{':1, '[': 1, '(': 1, ')':-1, ']':-1, '}':-1}
|
||||||
|
let s:blockCharsLUT = {'{':'{', '}':'{', '[':'[', ']':'[', '(':'(', ')':'('}
|
||||||
function! BalanceDirection (str)
|
function! BalanceDirection (str)
|
||||||
|
|
||||||
let balance = 0
|
let balance = {'{':0, '[': 0, '(': 0, 'none':0}
|
||||||
|
let director = 'none'
|
||||||
|
|
||||||
for c in split(a:str, '\zs')
|
for c in split(a:str, '\zs')
|
||||||
if has_key(s:blockChars, c)
|
if has_key(s:blockChars, c)
|
||||||
let balance += s:blockChars[c]
|
let balance[s:blockCharsLUT[c]] += s:blockChars[c]
|
||||||
|
|
||||||
|
if balance[s:blockCharsLUT[c]]
|
||||||
|
let director = s:blockCharsLUT[c]
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
return balance
|
return balance[director]
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
function! StripEndlineComments (line)
|
function! StripEndlineComments (line)
|
||||||
@ -308,7 +327,8 @@ endfun
|
|||||||
|
|
||||||
function! FindArrowIndent (lnum) " {{{
|
function! FindArrowIndent (lnum) " {{{
|
||||||
|
|
||||||
let parrentArrowPos = 0
|
let parrentArrowPos = -1
|
||||||
|
let cursorPos = -1
|
||||||
let lnum = a:lnum
|
let lnum = a:lnum
|
||||||
while lnum > 1
|
while lnum > 1
|
||||||
let last_line = getline(lnum)
|
let last_line = getline(lnum)
|
||||||
@ -316,31 +336,46 @@ function! FindArrowIndent (lnum) " {{{
|
|||||||
let parrentArrowPos = indent(a:lnum)
|
let parrentArrowPos = indent(a:lnum)
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
call cursor(lnum, 1)
|
|
||||||
let cleanedLnum = StripEndlineComments(last_line)
|
if b:PHP_noArrowMatching
|
||||||
if cleanedLnum =~ '->'
|
|
||||||
if ! b:PHP_noArrowMatching
|
|
||||||
let parrentArrowPos = searchpos('->', 'W', lnum)[1] - 1
|
|
||||||
else
|
|
||||||
let parrentArrowPos = indent(lnum) + shiftwidth()
|
|
||||||
endif
|
|
||||||
break
|
break
|
||||||
elseif cleanedLnum =~ ')'.s:endline && BalanceDirection(last_line) < 0
|
|
||||||
call searchpos(')'.s:endline, 'cW', lnum)
|
|
||||||
let openedparent = searchpair('(', '', ')', 'bW', 'Skippmatch()')
|
|
||||||
if openedparent != lnum
|
|
||||||
let lnum = openedparent
|
|
||||||
else
|
|
||||||
let openedparent = -1
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let cleanedLnum = StripEndlineComments(last_line)
|
||||||
|
|
||||||
|
if cleanedLnum =~ ')'.s:endline
|
||||||
|
if BalanceDirection(cleanedLnum) <= 0
|
||||||
|
call cursor(lnum, 1)
|
||||||
|
call searchpos(')'.s:endline, 'cW', lnum)
|
||||||
|
let openedparent = searchpair('(', '', ')', 'bW', 'Skippmatch()')
|
||||||
|
let cursorPos = col(".")
|
||||||
|
if openedparent != lnum
|
||||||
|
let lnum = openedparent
|
||||||
|
continue
|
||||||
else
|
else
|
||||||
let parrentArrowPos = indent(lnum) + shiftwidth()
|
endif
|
||||||
|
else
|
||||||
|
let parrentArrowPos = -1
|
||||||
|
break
|
||||||
|
end
|
||||||
|
endif
|
||||||
|
|
||||||
|
if cleanedLnum =~ '->'
|
||||||
|
call cursor(lnum, cursorPos == -1 ? strwidth(cleanedLnum) : cursorPos)
|
||||||
|
let parrentArrowPos = searchpos('->', 'cWb', lnum)[1] - 1
|
||||||
|
|
||||||
|
break
|
||||||
|
else
|
||||||
|
let parrentArrowPos = -1
|
||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endwhile
|
endwhile
|
||||||
|
|
||||||
|
if parrentArrowPos == -1
|
||||||
|
let parrentArrowPos = indent(lnum) + shiftwidth()
|
||||||
|
end
|
||||||
|
|
||||||
return parrentArrowPos
|
return parrentArrowPos
|
||||||
endfun "}}}
|
endfun "}}}
|
||||||
|
|
||||||
@ -432,7 +467,7 @@ function! IslinePHP (lnum, tofind) " {{{
|
|||||||
let synname = synIDattr(synID(a:lnum, coltotest, 0), "name")
|
let synname = synIDattr(synID(a:lnum, coltotest, 0), "name")
|
||||||
|
|
||||||
if synname ==? 'phpStringSingle' || synname ==? 'phpStringDouble' || synname ==? 'phpBacktick'
|
if synname ==? 'phpStringSingle' || synname ==? 'phpStringDouble' || synname ==? 'phpBacktick'
|
||||||
if cline !~ '^\s*[''"`]'
|
if cline !~ '^\s*[''"`]' " ??? XXX
|
||||||
return "SpecStringEntrails"
|
return "SpecStringEntrails"
|
||||||
else
|
else
|
||||||
return synname
|
return synname
|
||||||
@ -471,7 +506,7 @@ endfunc
|
|||||||
call ResetPhpOptions()
|
call ResetPhpOptions()
|
||||||
|
|
||||||
function! GetPhpIndentVersion()
|
function! GetPhpIndentVersion()
|
||||||
return "1.66-bundle"
|
return "1.70-bundle"
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
function! GetPhpIndent()
|
function! GetPhpIndent()
|
||||||
@ -615,7 +650,7 @@ function! GetPhpIndent()
|
|||||||
let b:InPHPcode_and_script = 1
|
let b:InPHPcode_and_script = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
elseif last_line =~ '^[^''"`]\+[''"`]$' " a string identifier with nothing after it and no other string identifier before
|
elseif last_line =~ '^[^''"`]\+[''"`]$' && last_line !~ '^\s*\%(//\|#\|/\*.*\*/\s*$\)' " a string identifier with nothing after it and no other string identifier before
|
||||||
let b:InPHPcode = -1
|
let b:InPHPcode = -1
|
||||||
let b:InPHPcode_tofind = substitute( last_line, '^.*\([''"`]\).*$', '^[^\1]*\1[;,]$', '')
|
let b:InPHPcode_tofind = substitute( last_line, '^.*\([''"`]\).*$', '^[^\1]*\1[;,]$', '')
|
||||||
elseif last_line =~? '<<<\s*[''"]\=\a\w*[''"]\=$'
|
elseif last_line =~? '<<<\s*[''"]\=\a\w*[''"]\=$'
|
||||||
@ -723,7 +758,7 @@ function! GetPhpIndent()
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
if last_line =~ '[;}]'.endline && last_line !~ '^[)\]]' && last_line !~# s:defaultORcase
|
if last_line =~ '[;}]'.endline && last_line !~ '^[)\]]' && last_line !~# s:defaultORcase && last_line !~ '^\s*[''"`][;,]'
|
||||||
if ind==b:PHP_default_indenting
|
if ind==b:PHP_default_indenting
|
||||||
return b:PHP_default_indenting + addSpecial
|
return b:PHP_default_indenting + addSpecial
|
||||||
elseif b:PHP_indentinghuge && ind==b:PHP_CurrentIndentLevel && cline !~# '^\s*\%(else\|\%(case\|default\).*:\|[})];\=\)' && last_line !~# '^\s*\%(\%(}\s*\)\=else\)' && getline(GetLastRealCodeLNum(lnum - 1))=~';'.endline
|
elseif b:PHP_indentinghuge && ind==b:PHP_CurrentIndentLevel && cline !~# '^\s*\%(else\|\%(case\|default\).*:\|[})];\=\)' && last_line !~# '^\s*\%(\%(}\s*\)\=else\)' && getline(GetLastRealCodeLNum(lnum - 1))=~';'.endline
|
||||||
@ -869,6 +904,14 @@ function! GetPhpIndent()
|
|||||||
let ind = ind + shiftwidth()
|
let ind = ind + shiftwidth()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if b:PHP_IndentFunctionCallParameters && last_line =~ s:multilineFunctionCall && last_line !~ s:structureHead && last_line !~ s:arrayDecl
|
||||||
|
let ind = ind + b:PHP_IndentFunctionCallParameters * shiftwidth()
|
||||||
|
endif
|
||||||
|
|
||||||
|
if b:PHP_IndentFunctionDeclarationParameters && last_line =~ s:multilineFunctionDecl
|
||||||
|
let ind = ind + b:PHP_IndentFunctionDeclarationParameters * shiftwidth()
|
||||||
|
endif
|
||||||
|
|
||||||
if b:PHP_BracesAtCodeLevel || b:PHP_vintage_case_default_indent == 1
|
if b:PHP_BracesAtCodeLevel || b:PHP_vintage_case_default_indent == 1
|
||||||
let b:PHP_CurrentIndentLevel = ind
|
let b:PHP_CurrentIndentLevel = ind
|
||||||
|
|
||||||
@ -897,10 +940,15 @@ function! GetPhpIndent()
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if cline =~ '^\s*[)\]];\='
|
if cline =~ '^\s*[)\]];\='
|
||||||
let ind = ind - shiftwidth()
|
call cursor(v:lnum, 1)
|
||||||
|
call searchpos('[)\]]', 'cW')
|
||||||
|
let matchedBlockChar = cline[col('.')-1]
|
||||||
|
let openedparent = searchpair('\M'.s:blockCharsLUT[matchedBlockChar], '', '\M'.matchedBlockChar, 'bW', 'Skippmatch()')
|
||||||
|
if openedparent != v:lnum
|
||||||
|
let ind = indent(openedparent)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if last_line =~ '^\s*->' && last_line !~? s:structureHead && BalanceDirection(last_line) <= 0
|
elseif last_line =~ '^\s*->' && last_line !~? s:structureHead && BalanceDirection(last_line) <= 0
|
||||||
let ind = ind - shiftwidth()
|
let ind = ind - shiftwidth()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -3,10 +3,13 @@
|
|||||||
" Maintainer: Christian Brabandt <cb@256bit.org>
|
" Maintainer: Christian Brabandt <cb@256bit.org>
|
||||||
" Original Author: Nikolai Weibull <now@bitwi.se>
|
" Original Author: Nikolai Weibull <now@bitwi.se>
|
||||||
" Previous Maintainer: Peter Aronoff <telemachus@arpinum.org>
|
" Previous Maintainer: Peter Aronoff <telemachus@arpinum.org>
|
||||||
" Latest Revision: 2019-04-27
|
" Latest Revision: 2019-07-26
|
||||||
" License: Vim (see :h license)
|
" License: Vim (see :h license)
|
||||||
" Repository: https://github.com/chrisbra/vim-sh-indent
|
" Repository: https://github.com/chrisbra/vim-sh-indent
|
||||||
" Changelog:
|
" Changelog:
|
||||||
|
" 20190726 - Correctly skip if keywords in syntax comments
|
||||||
|
" (issue #17)
|
||||||
|
" 20190603 - Do not indent in zsh filetypes with an `if` in comments
|
||||||
" 20190428 - De-indent fi correctly when typing with
|
" 20190428 - De-indent fi correctly when typing with
|
||||||
" https://github.com/chrisbra/vim-sh-indent/issues/15
|
" https://github.com/chrisbra/vim-sh-indent/issues/15
|
||||||
" 20190325 - Indent fi; correctly
|
" 20190325 - Indent fi; correctly
|
||||||
@ -80,8 +83,9 @@ function! GetShIndent()
|
|||||||
let ind = indent(lnum)
|
let ind = indent(lnum)
|
||||||
|
|
||||||
" Check contents of previous lines
|
" Check contents of previous lines
|
||||||
|
" should not apply to e.g. commented lines
|
||||||
if line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>' ||
|
if line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>' ||
|
||||||
\ (&ft is# 'zsh' && line =~ '\<\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>')
|
\ (&ft is# 'zsh' && line =~ '^\s*\<\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>')
|
||||||
if !s:is_end_expression(line)
|
if !s:is_end_expression(line)
|
||||||
let ind += s:indent_value('default')
|
let ind += s:indent_value('default')
|
||||||
endif
|
endif
|
||||||
@ -129,7 +133,8 @@ function! GetShIndent()
|
|||||||
" Current line is a endif line, so get indent from start of "if condition" line
|
" Current line is a endif line, so get indent from start of "if condition" line
|
||||||
" TODO: should we do the same for other "end" lines?
|
" TODO: should we do the same for other "end" lines?
|
||||||
if curline =~ '^\s*\%(fi\);\?\s*\%(#.*\)\=$'
|
if curline =~ '^\s*\%(fi\);\?\s*\%(#.*\)\=$'
|
||||||
let previous_line = searchpair('\<if\>', '', '\<fi\>\zs', 'bnW')
|
let ind = indent(v:lnum)
|
||||||
|
let previous_line = searchpair('\<if\>', '', '\<fi\>\zs', 'bnW', 'synIDattr(synID(line("."),col("."), 1),"name") =~? "comment"')
|
||||||
if previous_line > 0
|
if previous_line > 0
|
||||||
let ind = indent(previous_line)
|
let ind = indent(previous_line)
|
||||||
endif
|
endif
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
" Language: xml
|
" Language: xml
|
||||||
" Repository: https://github.com/chrisbra/vim-xml-ftplugin
|
" Repository: https://github.com/chrisbra/vim-xml-ftplugin
|
||||||
" Last Changed: Feb 04, 2019
|
" Last Changed: July 27, 2019
|
||||||
" Maintainer: Christian Brabandt <cb@256bit.org>
|
" Maintainer: Christian Brabandt <cb@256bit.org>
|
||||||
" Previous Maintainer: Johannes Zellner <johannes@zellner.org>
|
" Previous Maintainer: Johannes Zellner <johannes@zellner.org>
|
||||||
" Last Change:
|
" Last Change:
|
||||||
|
" 20190726 - Correctly handle non-tagged data
|
||||||
" 20190204 - correctly handle wrap tags
|
" 20190204 - correctly handle wrap tags
|
||||||
" https://github.com/chrisbra/vim-xml-ftplugin/issues/5
|
" https://github.com/chrisbra/vim-xml-ftplugin/issues/5
|
||||||
" 20190128 - Make sure to find previous tag
|
" 20190128 - Make sure to find previous tag
|
||||||
@ -33,6 +34,8 @@ set cpo&vim
|
|||||||
" Attention: Parameter use_syntax_check is used by the docbk.vim indent script
|
" Attention: Parameter use_syntax_check is used by the docbk.vim indent script
|
||||||
setlocal indentexpr=XmlIndentGet(v:lnum,1)
|
setlocal indentexpr=XmlIndentGet(v:lnum,1)
|
||||||
setlocal indentkeys=o,O,*<Return>,<>>,<<>,/,{,},!^F
|
setlocal indentkeys=o,O,*<Return>,<>>,<<>,/,{,},!^F
|
||||||
|
" autoindent: used when the indentexpr returns -1
|
||||||
|
setlocal autoindent
|
||||||
|
|
||||||
if !exists('b:xml_indent_open')
|
if !exists('b:xml_indent_open')
|
||||||
let b:xml_indent_open = '.\{-}<[:A-Z_a-z]'
|
let b:xml_indent_open = '.\{-}<[:A-Z_a-z]'
|
||||||
@ -103,37 +106,43 @@ fun! XmlIndentGet(lnum, use_syntax_check)
|
|||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
" Find previous line with a tag (regardless whether open or closed,
|
" Find previous line with a tag (regardless whether open or closed,
|
||||||
" but always start restrict the match to a line before the current one
|
" but always restrict the match to a line before the current one
|
||||||
" Note: xml declaration: <?xml version="1.0"?>
|
" Note: xml declaration: <?xml version="1.0"?>
|
||||||
" won't be found, as it is not a legal tag name
|
" won't be found, as it is not a legal tag name
|
||||||
let ptag_pattern = '\%(.\{-}<[/:A-Z_a-z]\)'. '\%(\&\%<'. line('.').'l\)'
|
let ptag_pattern = '\%(.\{-}<[/:A-Z_a-z]\)'. '\%(\&\%<'. a:lnum .'l\)'
|
||||||
let ptag = search(ptag_pattern, 'bnW')
|
let ptag = search(ptag_pattern, 'bnW')
|
||||||
" no previous tag
|
" no previous tag
|
||||||
if ptag == 0
|
if ptag == 0
|
||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let syn_name = ''
|
let pline = getline(ptag)
|
||||||
|
let pind = indent(ptag)
|
||||||
|
|
||||||
|
let syn_name_start = '' " Syntax element at start of line (excluding whitespace)
|
||||||
|
let syn_name_end = '' " Syntax element at end of line
|
||||||
|
let curline = getline(a:lnum)
|
||||||
if a:use_syntax_check
|
if a:use_syntax_check
|
||||||
let check_lnum = <SID>XmlIndentSynCheck(ptag)
|
let check_lnum = <SID>XmlIndentSynCheck(ptag)
|
||||||
let check_alnum = <SID>XmlIndentSynCheck(a:lnum)
|
let check_alnum = <SID>XmlIndentSynCheck(a:lnum)
|
||||||
if check_lnum == 0 || check_alnum == 0
|
if check_lnum == 0 || check_alnum == 0
|
||||||
return indent(a:lnum)
|
return indent(a:lnum)
|
||||||
endif
|
endif
|
||||||
let syn_name = synIDattr(synID(a:lnum, strlen(getline(a:lnum)) - 1, 1), 'name')
|
let syn_name_end = synIDattr(synID(a:lnum, strlen(curline) - 1, 1), 'name')
|
||||||
|
let syn_name_start = synIDattr(synID(a:lnum, match(curline, '\S') + 1, 1), 'name')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if syn_name =~ 'Comment'
|
if syn_name_end =~ 'Comment' && syn_name_start =~ 'Comment'
|
||||||
return <SID>XmlIndentComment(a:lnum)
|
return <SID>XmlIndentComment(a:lnum)
|
||||||
|
elseif empty(syn_name_start) && empty(syn_name_end)
|
||||||
|
" non-xml tag content: use indent from 'autoindent'
|
||||||
|
return pind + shiftwidth()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let pline = getline(ptag)
|
|
||||||
let pind = indent(ptag)
|
|
||||||
" Get indent from previous tag line
|
" Get indent from previous tag line
|
||||||
let ind = <SID>XmlIndentSum(pline, -1, pind)
|
let ind = <SID>XmlIndentSum(pline, -1, pind)
|
||||||
let t_ind = ind
|
|
||||||
" Determine indent from current line
|
" Determine indent from current line
|
||||||
let ind = <SID>XmlIndentSum(getline(a:lnum), 0, ind)
|
let ind = <SID>XmlIndentSum(curline, 0, ind)
|
||||||
return ind
|
return ind
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
@ -148,7 +157,7 @@ func! <SID>HasNoTagEnd(line)
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" return indent for a commented line,
|
" return indent for a commented line,
|
||||||
" the middle part might be indented on additional level
|
" the middle part might be indented one additional level
|
||||||
func! <SID>XmlIndentComment(lnum)
|
func! <SID>XmlIndentComment(lnum)
|
||||||
let ptagopen = search(b:xml_indent_open, 'bnW')
|
let ptagopen = search(b:xml_indent_open, 'bnW')
|
||||||
let ptagclose = search(b:xml_indent_close, 'bnW')
|
let ptagclose = search(b:xml_indent_close, 'bnW')
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
" Language: Valgrind Memory Debugger Output
|
" Language: Valgrind Memory Debugger Output
|
||||||
" Maintainer: Roger Luethi <rl@hellgate.ch>
|
" Maintainer: Roger Luethi <rl@hellgate.ch>
|
||||||
" Program URL: http://devel-home.kde.org/~sewardj/
|
" Program URL: http://devel-home.kde.org/~sewardj/
|
||||||
" Last Change: 2015 Jan 27
|
" Last Change: 2019 Jul 24
|
||||||
" Included improvement by Dominique Pelle
|
|
||||||
"
|
"
|
||||||
" Notes: mostly based on strace.vim and xml.vim
|
" Notes: mostly based on strace.vim and xml.vim
|
||||||
"
|
"
|
||||||
@ -26,7 +25,7 @@ syn match valgrindSpecLine "^[+-]\{2}\d\+[+-]\{2}.*$"
|
|||||||
|
|
||||||
syn region valgrindRegion
|
syn region valgrindRegion
|
||||||
\ start=+^==\z(\d\+\)== \w.*$+
|
\ start=+^==\z(\d\+\)== \w.*$+
|
||||||
\ skip=+^==\z1==\( \| .*\)$+
|
\ skip=+^==\z1==\( \| .*\| \S.*\)$+
|
||||||
\ end=+^+
|
\ end=+^+
|
||||||
\ fold
|
\ fold
|
||||||
\ keepend
|
\ keepend
|
||||||
@ -70,7 +69,7 @@ syn match valgrindLoc "\s\+\(by\|at\|Address\).*$" contained
|
|||||||
syn match valgrindAt "at\s\@=" contained
|
syn match valgrindAt "at\s\@=" contained
|
||||||
syn match valgrindAddr "\W\zs0x\x\+" contained
|
syn match valgrindAddr "\W\zs0x\x\+" contained
|
||||||
|
|
||||||
syn match valgrindFunc ": \zs\h[a-zA-Z0-9_:\[\]()<>&*+\-,=%!|^ ]*\ze([^)]*)$" contained
|
syn match valgrindFunc ": \zs\h[a-zA-Z0-9_:\[\]()<>&*+\-,=%!|^ @.]*\ze([^)]*)$" contained
|
||||||
syn match valgrindBin "(\(with\)\=in \zs\S\+)\@=" contained
|
syn match valgrindBin "(\(with\)\=in \zs\S\+)\@=" contained
|
||||||
syn match valgrindSrc "(\zs[^)]*:\d\+)\@=" contained
|
syn match valgrindSrc "(\zs[^)]*:\d\+)\@=" contained
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user