mirror of
https://github.com/zoriya/vim.git
synced 2025-12-25 00:25:21 +00:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be01090efa | ||
|
|
b16ff292ad | ||
|
|
f8dbd58666 | ||
|
|
56858e4ed4 | ||
|
|
23003e51e1 | ||
|
|
40fa12aea3 | ||
|
|
da0b497c6e | ||
|
|
34cc7d8c03 | ||
|
|
690c524ce6 | ||
|
|
770ddbe159 | ||
|
|
18fefddcb0 | ||
|
|
c04f62346b | ||
|
|
1d34189ecb | ||
|
|
d2b98ab4ec | ||
|
|
820d5525ca | ||
|
|
542ffe16a1 |
48
.github/workflows/ci.yml
vendored
48
.github/workflows/ci.yml
vendored
@@ -201,18 +201,18 @@ jobs:
|
||||
do_test() { sg audio "sg $(id -gn) '$*'"; }
|
||||
do_test make ${SHADOWOPT} ${TEST}
|
||||
|
||||
- name: Coveralls
|
||||
if: matrix.coverage && success() && github.event_name != 'pull_request'
|
||||
env:
|
||||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
||||
COVERALLS_PARALLEL: true
|
||||
TRAVIS_JOB_ID: ${{ github.run_id }}
|
||||
run: |
|
||||
sudo apt-get install -y python3-setuptools python3-wheel
|
||||
sudo -H pip3 install pip -U
|
||||
# needed for https support for coveralls building cffi only works with gcc, not with clang
|
||||
CC=gcc pip3 install --user cpp-coveralls pyopenssl ndg-httpsclient pyasn1
|
||||
~/.local/bin/coveralls -b "${SRCDIR}" -x .xs -e "${SRCDIR}"/if_perl.c -e "${SRCDIR}"/xxd -e "${SRCDIR}"/libvterm --encodings utf-8
|
||||
# - name: Coveralls
|
||||
# if: matrix.coverage && success() && github.event_name != 'pull_request'
|
||||
# env:
|
||||
# COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
||||
# COVERALLS_PARALLEL: true
|
||||
# TRAVIS_JOB_ID: ${{ github.run_id }}
|
||||
# run: |
|
||||
# sudo apt-get install -y python3-setuptools python3-wheel
|
||||
# sudo -H pip3 install pip -U
|
||||
# # needed for https support for coveralls building cffi only works with gcc, not with clang
|
||||
# CC=gcc pip3 install --user cpp-coveralls pyopenssl ndg-httpsclient pyasn1
|
||||
# ~/.local/bin/coveralls -b "${SRCDIR}" -x .xs -e "${SRCDIR}"/if_perl.c -e "${SRCDIR}"/xxd -e "${SRCDIR}"/libvterm --encodings utf-8
|
||||
|
||||
- name: Codecov
|
||||
if: matrix.coverage && success()
|
||||
@@ -228,18 +228,18 @@ jobs:
|
||||
false # in order to fail a job
|
||||
done
|
||||
|
||||
coveralls:
|
||||
runs-on: ubuntu-18.04
|
||||
|
||||
needs: linux
|
||||
if: always() && github.event_name != 'pull_request'
|
||||
|
||||
steps:
|
||||
- name: Parallel finished
|
||||
env:
|
||||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
||||
run: |
|
||||
curl -k "https://coveralls.io/webhook?repo_token=${COVERALLS_REPO_TOKEN}" -d "payload[build_num]=${GITHUB_RUN_ID}&payload[status]=done"
|
||||
# coveralls:
|
||||
# runs-on: ubuntu-18.04
|
||||
#
|
||||
# needs: linux
|
||||
# if: always() && github.event_name != 'pull_request'
|
||||
#
|
||||
# steps:
|
||||
# - name: Parallel finished
|
||||
# env:
|
||||
# COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
||||
# run: |
|
||||
# curl -k "https://coveralls.io/webhook?repo_token=${COVERALLS_REPO_TOKEN}" -d "payload[build_num]=${GITHUB_RUN_ID}&payload[status]=done"
|
||||
|
||||
macos:
|
||||
runs-on: macos-latest
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
" plus CSS Speech Module <http://www.w3.org/TR/css3-speech/>
|
||||
" Maintainer: Kao, Wei-Ko(othree) ( othree AT gmail DOT com )
|
||||
" Original Author: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" Last Change: 2018 Jul 02
|
||||
" Last Change: 2021 Sep 21
|
||||
|
||||
let s:values = split("all additive-symbols align-content align-items align-self animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function backface-visibility background background-attachment background-blend-mode background-clip background-color background-image background-origin background-position background-repeat background-size block-size border border-block-end border-block-end-color border-block-end-style border-block-end-width border-block-start border-block-start-color border-block-start-style border-block-start-width border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-inline-end border-inline-end-color border-inline-end-style border-inline-end-width border-inline-start border-inline-start-color border-inline-start-style border-inline-start-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-decoration-break box-shadow box-sizing break-after break-before break-inside caption-side clear clip clip-path color columns column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width content counter-increment counter-reset cue cue-before cue-after cursor direction display empty-cells fallback filter flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float font font-family font-feature-settings font-kerning font-language-override font-size font-size-adjust font-stretch font-style font-synthesis font-variant font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric font-variant-position font-weight grid grid-area grid-auto-columns grid-auto-flow grid-auto-position grid-auto-rows grid-column grid-column-start grid-column-end grid-row grid-row-start grid-row-end grid-template grid-template-areas grid-template-rows grid-template-columns height hyphens image-rendering image-resolution image-orientation ime-mode inline-size isolation justify-content left letter-spacing line-break line-height list-style list-style-image list-style-position list-style-type margin margin-block-end margin-block-start margin-bottom margin-inline-end margin-inline-start margin-left margin-right margin-top marks mask mask-type max-block-size max-height max-inline-size max-width max-zoom min-block-size min-height min-inline-size min-width min-zoom mix-blend-mode negative object-fit object-position offset-block-end offset-block-start offset-inline-end offset-inline-start opacity order orientation orphans outline outline-color outline-offset outline-style outline-width overflow overflow-wrap overflow-x overflow-y pad padding padding-block-end padding-block-start padding-bottom padding-inline-end padding-inline-start padding-left padding-right padding-top page-break-after page-break-before page-break-inside pause-before pause-after pause perspective perspective-origin pointer-events position prefix quotes range resize rest rest-before rest-after right ruby-align ruby-merge ruby-position scroll-behavior scroll-snap-coordinate scroll-snap-destination scroll-snap-points-x scroll-snap-points-y scroll-snap-type scroll-snap-type-x scroll-snap-type-y shape-image-threshold shape-margin shape-outside speak speak-as suffix symbols system table-layout tab-size text-align text-align-last text-combine-upright text-decoration text-decoration-color text-decoration-line text-emphasis text-emphasis-color text-emphasis-position text-emphasis-style text-indent text-orientation text-overflow text-rendering text-shadow text-transform text-underline-position top touch-action transform transform-box transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi unicode-range user-zoom vertical-align visibility voice-balance voice-duration voice-family voice-pitch voice-rate voice-range voice-stress voice-volume white-space widows width will-change word-break word-spacing word-wrap writing-mode z-index zoom")
|
||||
|
||||
@@ -38,12 +38,12 @@ function! csscomplete#CompleteCSS(findstart, base)
|
||||
if exists("b:compl_context")
|
||||
let line = getline('.')
|
||||
let compl_begin = col('.') - 2
|
||||
let after = line[compl_begin:]
|
||||
let b:after = line[compl_begin:]
|
||||
let line = b:compl_context
|
||||
unlet! b:compl_context
|
||||
else
|
||||
let line = a:base
|
||||
let after = ''
|
||||
let b:after = ''
|
||||
endif
|
||||
|
||||
let res = []
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.2. Last change: 2021 Sep 08
|
||||
*eval.txt* For Vim version 8.2. Last change: 2021 Sep 19
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -658,7 +658,7 @@ It is not necessary to use the "dict" attribute for a numbered function.
|
||||
|
||||
If you get an error for a numbered function, you can find out what it is with
|
||||
a trick. Assuming the function is 42, the command is: >
|
||||
:function {42}
|
||||
:function g:42
|
||||
|
||||
|
||||
Functions for Dictionaries ~
|
||||
@@ -6140,6 +6140,7 @@ getreg([{regname} [, 1 [, {list}]]]) *getreg()*
|
||||
(see |NL-used-for-Nul|).
|
||||
When the register was not set an empty list is returned.
|
||||
|
||||
If {regname} is "", the unnamed register '"' is used.
|
||||
If {regname} is not specified, |v:register| is used.
|
||||
In |Vim9-script| {regname} must be one character.
|
||||
|
||||
@@ -6167,6 +6168,7 @@ getreginfo([{regname}]) *getreginfo()*
|
||||
|
||||
The {regname} argument is a string. If {regname} is invalid
|
||||
or not set, an empty Dictionary will be returned.
|
||||
If {regname} is "" or "@", the unnamed register '"' is used.
|
||||
If {regname} is not specified, |v:register| is used.
|
||||
The returned Dictionary can be passed to |setreg()|.
|
||||
In |Vim9-script| {regname} must be one character.
|
||||
@@ -6182,8 +6184,9 @@ getregtype([{regname}]) *getregtype()*
|
||||
"<CTRL-V>{width}" for |blockwise-visual| text
|
||||
"" for an empty or unknown register
|
||||
<CTRL-V> is one character with value 0x16.
|
||||
The {regname} argument is a string. If {regname} is not
|
||||
specified, |v:register| is used.
|
||||
The {regname} argument is a string. If {regname} is "", the
|
||||
unnamed register '"' is used. If {regname} is not specified,
|
||||
|v:register| is used.
|
||||
In |Vim9-script| {regname} must be one character.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
@@ -12078,6 +12081,7 @@ There are three types of features:
|
||||
1. Features that are only supported when they have been enabled when Vim
|
||||
was compiled |+feature-list|. Example: >
|
||||
:if has("cindent")
|
||||
< *gui_running*
|
||||
2. Features that are only supported when certain conditions have been met.
|
||||
Example: >
|
||||
:if has("gui_running")
|
||||
|
||||
@@ -545,6 +545,14 @@ One command, :DiffGitCached, is provided to show a diff of the current commit
|
||||
in the preview window. It is equivalent to calling "git diff --cached" plus
|
||||
any arguments given to the command.
|
||||
|
||||
GPROF
|
||||
|
||||
The gprof filetype plugin defines a mapping <C-]> to jump from a function
|
||||
entry in the gprof flat profile or from a function entry in the call graph
|
||||
to the details of that function in the call graph.
|
||||
|
||||
The mapping can be disabled with: >
|
||||
let g:no_gprof_maps = 1
|
||||
|
||||
MAIL *ft-mail-plugin*
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 8.2. Last change: 2021 Aug 05
|
||||
*map.txt* For Vim version 8.2. Last change: 2021 Sep 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.2. Last change: 2021 Sep 06
|
||||
*options.txt* For Vim version 8.2. Last change: 2021 Sep 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -4983,7 +4983,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
:set lcs=tab:>-,eol:<,nbsp:%
|
||||
:set lcs=extends:>,precedes:<
|
||||
< The "NonText" highlighting will be used for "eol", "extends" and
|
||||
"precedes". "SpecialKey" for "nbsp", "space", "tab" and "trail".
|
||||
"precedes". "SpecialKey" will be used for "tab", "nbsp", "space",
|
||||
"multispace", "lead" and "trail".
|
||||
|hl-NonText| |hl-SpecialKey|
|
||||
|
||||
*'lpl'* *'nolpl'* *'loadplugins'* *'noloadplugins'*
|
||||
@@ -8780,8 +8781,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
More info here: |cmdline-completion|.
|
||||
The character is not recognized when used inside a macro. See
|
||||
'wildcharm' for that.
|
||||
Some keys will not work, such as CTRL-C, <CR> and Enter.
|
||||
Although 'wc' is a number option, you can set it to a special key: >
|
||||
:set wc=<Esc>
|
||||
:set wc=<Tab>
|
||||
< NOTE: This option is set to the Vi default value when 'compatible' is
|
||||
set and to the Vim default value when 'compatible' is reset.
|
||||
|
||||
|
||||
@@ -520,6 +520,7 @@ sign_jump({id}, {group}, {buf})
|
||||
{buf} and position the cursor at sign {id} in group {group}.
|
||||
This is similar to the |:sign-jump| command.
|
||||
|
||||
If {group} is an empty string, then the global group is used.
|
||||
For the use of {buf}, see |bufname()|.
|
||||
|
||||
Returns the line number of the sign. Returns -1 if the
|
||||
|
||||
@@ -3989,6 +3989,8 @@ E123 eval.txt /*E123*
|
||||
E1231 map.txt /*E1231*
|
||||
E1232 eval.txt /*E1232*
|
||||
E1233 eval.txt /*E1233*
|
||||
E1237 map.txt /*E1237*
|
||||
E1239 eval.txt /*E1239*
|
||||
E124 eval.txt /*E124*
|
||||
E125 eval.txt /*E125*
|
||||
E126 eval.txt /*E126*
|
||||
@@ -5015,6 +5017,7 @@ Macintosh os_mac.txt /*Macintosh*
|
||||
Mark motion.txt /*Mark*
|
||||
MenuPopup autocmd.txt /*MenuPopup*
|
||||
MiNT os_mint.txt /*MiNT*
|
||||
ModeChanged autocmd.txt /*ModeChanged*
|
||||
Moolenaar intro.txt /*Moolenaar*
|
||||
MorphOS os_amiga.txt /*MorphOS*
|
||||
Motif gui_x11.txt /*Motif*
|
||||
@@ -5553,10 +5556,12 @@ beval_winnr-variable eval.txt /*beval_winnr-variable*
|
||||
binary-number eval.txt /*binary-number*
|
||||
bitwise-function usr_41.txt /*bitwise-function*
|
||||
blob eval.txt /*blob*
|
||||
blob-functions usr_41.txt /*blob-functions*
|
||||
blob-identity eval.txt /*blob-identity*
|
||||
blob-index eval.txt /*blob-index*
|
||||
blob-literal eval.txt /*blob-literal*
|
||||
blob-modification eval.txt /*blob-modification*
|
||||
blob2list() eval.txt /*blob2list()*
|
||||
blockwise-examples visual.txt /*blockwise-examples*
|
||||
blockwise-operators visual.txt /*blockwise-operators*
|
||||
blockwise-register change.txt /*blockwise-register*
|
||||
@@ -7200,6 +7205,7 @@ gui-x11-printing gui_x11.txt /*gui-x11-printing*
|
||||
gui-x11-start gui_x11.txt /*gui-x11-start*
|
||||
gui-x11-various gui_x11.txt /*gui-x11-various*
|
||||
gui.txt gui.txt /*gui.txt*
|
||||
gui_running eval.txt /*gui_running*
|
||||
gui_w32.txt gui_w32.txt /*gui_w32.txt*
|
||||
gui_x11.txt gui_x11.txt /*gui_x11.txt*
|
||||
guifontwide_gtk gui.txt /*guifontwide_gtk*
|
||||
@@ -7701,6 +7707,7 @@ lcs-conceal options.txt /*lcs-conceal*
|
||||
lcs-eol options.txt /*lcs-eol*
|
||||
lcs-extends options.txt /*lcs-extends*
|
||||
lcs-lead options.txt /*lcs-lead*
|
||||
lcs-multispace options.txt /*lcs-multispace*
|
||||
lcs-nbsp options.txt /*lcs-nbsp*
|
||||
lcs-precedes options.txt /*lcs-precedes*
|
||||
lcs-space options.txt /*lcs-space*
|
||||
@@ -7735,6 +7742,7 @@ list-identity eval.txt /*list-identity*
|
||||
list-index eval.txt /*list-index*
|
||||
list-modification eval.txt /*list-modification*
|
||||
list-repeat windows.txt /*list-repeat*
|
||||
list2blob() eval.txt /*list2blob()*
|
||||
list2str() eval.txt /*list2str()*
|
||||
listener_add() eval.txt /*listener_add()*
|
||||
listener_flush() eval.txt /*listener_flush()*
|
||||
|
||||
@@ -160,7 +160,7 @@ prop_add({lnum}, {col}, {props})
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetLnum()->prop_add(col, props)
|
||||
|
||||
<
|
||||
*prop_add_list()*
|
||||
prop_add_list({props}, [[{lnum}, {col}, {end-lnum}, {end-col}], ...])
|
||||
Similar to prop_add(), but attaches a text property at
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.2. Last change: 2021 Sep 08
|
||||
*todo.txt* For Vim version 8.2. Last change: 2021 Sep 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -38,12 +38,14 @@ browser use: https://github.com/vim/vim/issues/1234
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
:delcommand -buffer should work
|
||||
Flaky test op Windows:
|
||||
From test_vim9_script.vim:
|
||||
Found errors in Test_no_unknown_error_after_error():
|
||||
command line..script D:/a/vim/vim/src2/testdir/runtest.vim[486]..function RunTheTest[44]..Test_no_unknown_error_after_error line 22: Expected 'E1012:' but got 'E684: list index out of range: 0': so Xdef
|
||||
|
||||
Vim9 - Make everything work:
|
||||
- Disallow using numbered function with "g:123" in Vim9 script? #8760
|
||||
- use CheckLegacyAndVim9Success(lines) in many more places
|
||||
- Check TODO items in vim9compile.c and vim9execute.c
|
||||
- use CheckLegacyAndVim9Success(lines) in many more places
|
||||
- For builtin functions using tv_get_string*() use check_for_string() to be
|
||||
more strict about the argument type (not a bool).
|
||||
done: balloon_()
|
||||
@@ -366,10 +368,6 @@ autocommands for the buffer lifecycle:
|
||||
BufIsRenamed (after buffer ID gets another name)
|
||||
The buffer list and windows are locked, no changes possible
|
||||
|
||||
Add a ModeChanged autocommand that has an argument indicating the old and new
|
||||
mode, as what's returned from mode(). Also used for switching Terminal mode.
|
||||
#8360, #7863, #7363
|
||||
|
||||
Matchparen doesn't remove highlight after undo. (#7054)
|
||||
Is OK when syntax HL is active.
|
||||
|
||||
@@ -4845,7 +4843,6 @@ Autocommands:
|
||||
command used dos fileformat. Same for 'fileencoding'.
|
||||
- Add events to autocommands:
|
||||
Error - When an error happens
|
||||
ModeChange - after changing mode (before waiting for a char)
|
||||
VimLeaveCheck - Before Vim decides to exit, so that it can be cancelled
|
||||
when exiting isn't a good idea.
|
||||
CursorHoldC - CursorHold while command-line editing
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_41.txt* For Vim version 8.2. Last change: 2021 Aug 08
|
||||
*usr_41.txt* For Vim version 8.2. Last change: 2021 Sep 10
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2021 Sep 08
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2021 Sep 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -180,6 +180,15 @@ For now you will need to pass the dictionary explicitly: >
|
||||
var d = {item: 'value', func: DictFunc}
|
||||
d.func(d, 'item')
|
||||
|
||||
You can call a legacy dict function though: >
|
||||
func Legacy() dict
|
||||
echo self.value
|
||||
endfunc
|
||||
def CallLegacy()
|
||||
var d = {func: Legacy, value: 'text'}
|
||||
d.func()
|
||||
enddef
|
||||
|
||||
The argument types and return type need to be specified. The "any" type can
|
||||
be used, type checking will then be done at runtime, like with legacy
|
||||
functions.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2021 Aug 23
|
||||
" Last Change: 2021 Sep 21
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@@ -488,7 +488,7 @@ au BufNewFile,BufRead *.desktop,*.directory setf desktop
|
||||
au BufNewFile,BufRead dict.conf,.dictrc setf dictconf
|
||||
|
||||
" Dictd config
|
||||
au BufNewFile,BufRead dictd.conf setf dictdconf
|
||||
au BufNewFile,BufRead dictd*.conf setf dictdconf
|
||||
|
||||
" Diff files
|
||||
au BufNewFile,BufRead *.diff,*.rej setf diff
|
||||
@@ -1092,6 +1092,9 @@ au BufNewFile,BufRead *.moo setf moo
|
||||
" Modconf
|
||||
au BufNewFile,BufRead */etc/modules.conf,*/etc/modules,*/etc/conf.modules setf modconf
|
||||
|
||||
" MPD is based on XML
|
||||
au BufNewFile,BufRead *.mpd setf xml
|
||||
|
||||
" Mplayer config
|
||||
au BufNewFile,BufRead mplayer.conf,*/.mplayer/config setf mplayerconf
|
||||
|
||||
@@ -2138,7 +2141,7 @@ au BufNewFile,BufRead proftpd.conf* call s:StarSetf('apachestyle')
|
||||
|
||||
" More Apache config files
|
||||
au BufNewFile,BufRead access.conf*,apache.conf*,apache2.conf*,httpd.conf*,srm.conf* call s:StarSetf('apache')
|
||||
au BufNewFile,BufRead */etc/apache2/*.conf*,*/etc/apache2/conf.*/*,*/etc/apache2/mods-*/*,*/etc/apache2/sites-*/*,*/etc/httpd/conf.d/*.conf* call s:StarSetf('apache')
|
||||
au BufNewFile,BufRead */etc/apache2/*.conf*,*/etc/apache2/conf.*/*,*/etc/apache2/mods-*/*,*/etc/apache2/sites-*/*,*/etc/httpd/conf.*/*,*/etc/httpd/mods-*/*,*/etc/httpd/sites-*/*,*/etc/httpd/conf.d/*.conf* call s:StarSetf('apache')
|
||||
|
||||
" Asterisk config file
|
||||
au BufNewFile,BufRead *asterisk/*.conf* call s:StarSetf('asterisk')
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
" Vim ftplugin file
|
||||
" Language: 8th
|
||||
" Version: any
|
||||
" Last Change: 2015/11/08
|
||||
" Last Change: 2021 Sep 20
|
||||
" Last Change: 2021/09/20
|
||||
" Maintainer: Ron Aaron <ron@aaron-tech.com>
|
||||
" URL: https://8th-dev.com/
|
||||
" URL: https://8th-dev.com/
|
||||
" Filetypes: *.8th
|
||||
" NOTE: 8th allows any non-whitespace in a name, so you need to do:
|
||||
" setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
|
||||
@@ -14,12 +15,13 @@ if exists("b:did_8thplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Don't load another plugin for this buffer
|
||||
" Don't load another 8th plugin for this buffer
|
||||
let b:did_8thplugin = 1
|
||||
|
||||
setlocal ts=2 sts=2 sw=2 et
|
||||
setlocal com=s1:/*,mb:*,ex:*/,:\|,:\\
|
||||
setlocal com=s1:/*,mb:*,ex:*/,b:--,be:\\
|
||||
setlocal fo=tcrqol
|
||||
setlocal matchpairs+=\::;
|
||||
setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
|
||||
setlocal suffixesadd=.8th
|
||||
let b:undo_ftplugin = "setlocal ts< sts< sw< et< com< fo< mps< isk< sua<"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: C
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2020 Feb 01
|
||||
" Last Change: 2021 Sep 21
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -40,8 +40,11 @@ endif
|
||||
|
||||
" When the matchit plugin is loaded, this makes the % command skip parens and
|
||||
" braces in comments properly.
|
||||
let b:match_words = '^\s*#\s*if\(\|def\|ndef\)\>:^\s*#\s*elif\>:^\s*#\s*else\>:^\s*#\s*endif\>'
|
||||
let b:match_skip = 's:comment\|string\|character\|special'
|
||||
if !exists("b:match_words")
|
||||
let b:match_words = '^\s*#\s*if\(\|def\|ndef\)\>:^\s*#\s*elif\>:^\s*#\s*else\>:^\s*#\s*endif\>'
|
||||
let b:match_skip = 's:comment\|string\|character\|special'
|
||||
let b:undo_ftplugin ..= " | unlet! b:match_skip b:match_words"
|
||||
endif
|
||||
|
||||
" Win32 can filter files in the browse dialog
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
@@ -62,6 +65,7 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
\ "C++ Source Files (*.cpp *.c++)\t*.cpp;*.c++\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
let b:undo_ftplugin ..= " | unlet! b:browsefilter"
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
" Language: gprof
|
||||
" Maintainer: Dominique Pelle <dominique.pelle@gmail.com>
|
||||
" Last Change: 2021 Apr 08
|
||||
" Language: gprof
|
||||
" Maintainer: Dominique Pelle <dominique.pelle@gmail.com>
|
||||
" Contributors: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2021 Sep 19
|
||||
|
||||
" When cursor is on one line of the gprof call graph,
|
||||
" calling this function jumps to this function in the call graph.
|
||||
@@ -9,7 +10,7 @@ if exists("b:did_ftplugin")
|
||||
endif
|
||||
let b:did_ftplugin=1
|
||||
|
||||
fun! <SID>GprofJumpToFunctionIndex()
|
||||
func! <SID>GprofJumpToFunctionIndex()
|
||||
let l:line = getline('.')
|
||||
if l:line =~ '[\d\+\]$'
|
||||
" We're in a line in the call graph.
|
||||
@@ -22,11 +23,14 @@ fun! <SID>GprofJumpToFunctionIndex()
|
||||
call search('^\[\d\+\].*\d\s\+' . escape(@", '[]*.') . '\>', 'sW')
|
||||
norm! zz
|
||||
endif
|
||||
endfun
|
||||
endfunc
|
||||
|
||||
" Pressing <C-]> on a line in the gprof flat profile or in
|
||||
" the call graph, jumps to the corresponding function inside
|
||||
" the flat profile.
|
||||
map <buffer> <silent> <C-]> :call <SID>GprofJumpToFunctionIndex()<CR>
|
||||
if !exists("no_plugin_maps") && !exists("no_gprof_maps")
|
||||
" Pressing <C-]> on a line in the gprof flat profile or in
|
||||
" the call graph, jumps to the corresponding function inside
|
||||
" the flat profile.
|
||||
map <buffer> <silent> <C-]> :call <SID>GprofJumpToFunctionIndex()<CR>
|
||||
let b:undo_ftplugin = "silent! unmap <buffer> <C-]>"
|
||||
endif
|
||||
|
||||
" vim:sw=2 fdm=indent
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
" go.vim: Vim syntax file for Go.
|
||||
" Language: Go
|
||||
" Maintainer: Billie Cleek <bhcleek@gmail.com>
|
||||
" Latest Revision: 2021-06-26
|
||||
" Latest Revision: 2021-09-18
|
||||
" License: BSD-style. See LICENSE file in source repository.
|
||||
" Repository: https://github.com/fatih/vim-go
|
||||
|
||||
@@ -250,7 +250,7 @@ syn match goDecimalError "\<-\=\(_\(\d\+_*\)\+\|\([1-9]\d*_*\)\+__\(\
|
||||
syn match goHexadecimalInt "\<-\=0[xX]_\?\(\x\+_\?\)\+\>"
|
||||
syn match goHexadecimalError "\<-\=0[xX]_\?\(\x\+_\?\)*\(\([^ \t0-9A-Fa-f_)]\|__\)\S*\|_\)\>"
|
||||
syn match goOctalInt "\<-\=0[oO]\?_\?\(\o\+_\?\)\+\>"
|
||||
syn match goOctalError "\<-\=0[0-7oO_]*\(\([^ \t0-7oOxX_/)\]\}\:]\|[oO]\{2,\}\|__\)\S*\|_\|[oOxX]\)\>"
|
||||
syn match goOctalError "\<-\=0[0-7oO_]*\(\([^ \t0-7oOxX_/)\]\}\:;]\|[oO]\{2,\}\|__\)\S*\|_\|[oOxX]\)\>"
|
||||
syn match goBinaryInt "\<-\=0[bB]_\?\([01]\+_\?\)\+\>"
|
||||
syn match goBinaryError "\<-\=0[bB]_\?[01_]*\([^ \t01_)]\S*\|__\S*\|_\)\>"
|
||||
|
||||
@@ -430,7 +430,7 @@ endif
|
||||
|
||||
" Build Constraints
|
||||
if s:HighlightBuildConstraints()
|
||||
syn match goBuildKeyword display contained "+build"
|
||||
syn match goBuildKeyword display contained "+build\|go:build"
|
||||
" Highlight the known values of GOOS, GOARCH, and other +build options.
|
||||
syn keyword goBuildDirectives contained
|
||||
\ android darwin dragonfly freebsd linux nacl netbsd openbsd plan9
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
" Vim syntax file
|
||||
" Language: Syntax for Gprof Output
|
||||
" Maintainer: Dominique Pelle <dominique.pelle@gmail.com>
|
||||
" Last Change: 2021 Apr 08
|
||||
" Last Change: 2021 Sep 19
|
||||
|
||||
" Quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
finish
|
||||
endif
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn spell notoplevel
|
||||
syn case match
|
||||
syn sync minlines=100
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: php PHP 3/4/5/7/8
|
||||
" Maintainer: Tyson Andre <tysonandre775@hotmail.com>
|
||||
" Last Change: Dec 22, 2020
|
||||
" Last Change: Sep 18, 2021
|
||||
" URL: https://github.com/TysonAndre/php-vim-syntax
|
||||
" Former Maintainers:
|
||||
" Jason Woofenden <jason@jasonwoof.com>
|
||||
@@ -13,10 +13,32 @@
|
||||
" than the default colourscheme, because elflord's colours will better
|
||||
" highlight the break-points (Statements) in your code.
|
||||
"
|
||||
" Note: This embeds a modified copy of the html.vim with (mostly) different symbols,
|
||||
" in order to implement php_htmlInStrings=2 can work as expected and correctly parse
|
||||
" `<?php $phpStartTag = '<?php';`.
|
||||
"
|
||||
" Credits for the original version of html.vim prior to modifications
|
||||
"
|
||||
" Previous Maintainer Jorge Maldonado Ventura <jorgesumle@freakspot.net>
|
||||
" Previous Maintainer Claudio Fleiner <claudio@fleiner.com>
|
||||
" Repository https://notabug.org/jorgesumle/vim-html-syntax
|
||||
" Last Change 2021 Mar 02
|
||||
" Included patch #7900 to fix comments
|
||||
" Included patch #7916 to fix a few more things
|
||||
"
|
||||
" Options:
|
||||
" Set to anything to enable:
|
||||
" php_sql_query SQL syntax highlighting inside strings
|
||||
" php_htmlInStrings HTML syntax highlighting inside strings
|
||||
"
|
||||
" By setting this to 2, this will use a local copy of
|
||||
" HTML syntax highlighting instead of the official
|
||||
" HTML syntax highlighting, and properly highlight
|
||||
" `<?php $startTag = '<?php';`.
|
||||
" This may become the new default in the future.
|
||||
"
|
||||
" By setting this to 3 (or any unrecognized value),
|
||||
" this will use the official installed top level html syntax highlighting rules.
|
||||
" php_baselib highlighting baselib functions
|
||||
" php_asp_tags highlighting ASP-style short tags
|
||||
" php_parent_error_close highlighting parent error ] or )
|
||||
@@ -62,6 +84,214 @@ if !exists("main_syntax")
|
||||
let main_syntax = 'php'
|
||||
endif
|
||||
|
||||
" Start of copy of html for embedding in strings with {{{
|
||||
" This is a clone of https://notabug.org/jorgesumle/vim-html-syntax
|
||||
" from 2021 Mar 02 with changed symbols and modifications to rules. See the Note in the file header.
|
||||
"
|
||||
" The default behavior of php_htmlInStrings causes a bug
|
||||
" when you're working with code that contains the string literal `'<?php'`.
|
||||
" E.g. code that reads php files or generates the contents of php files or
|
||||
" generates snippets to `eval()`.
|
||||
"
|
||||
" When php_htmlInStrings was set to any value,
|
||||
" it would cause the html syntax rules to be embedded inside of the string
|
||||
" contents.
|
||||
"
|
||||
" However, php.vim extends html.vim by allowing the php start tag to be
|
||||
" included, meaning that this is parsed as `<?php';`, i.e. the start of a
|
||||
" new string literal.
|
||||
"
|
||||
" Work around that by using a different set of rules that don't allow
|
||||
" embedding php in most places (phpInnerHtmlPreProc).
|
||||
"
|
||||
" The default behavior may be changed to this in the future for constants other
|
||||
" than 2 or 3 if there are no issues.
|
||||
"
|
||||
" Many, but not all syntax rules were changed from html* to phpInnerHtml*
|
||||
if exists("php_htmlInStrings") && php_htmlInStrings==2
|
||||
" mark illegal characters
|
||||
syn match phpInnerHtmlError contained "[<>&]"
|
||||
|
||||
" tags
|
||||
syn region phpInnerHtmlString contained start=+"+ end=+"+ contains=phpInnerHtmlSpecialChar,javaScriptExpression,@phpInnerHtmlPreproc
|
||||
syn region phpInnerHtmlString contained start=+'+ end=+'+ contains=phpInnerHtmlSpecialChar,javaScriptExpression,@phpInnerHtmlPreproc
|
||||
syn match phpInnerHtmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 contains=javaScriptExpression,@phpInnerHtmlPreproc
|
||||
syn region phpInnerHtmlEndTag contained start=+</+ end=+>+ contains=phpInnerHtmlTagN,phpInnerHtmlTagError
|
||||
syn region phpInnerHtmlTag contained start=+<[^/]+ end=+>+ fold contains=phpInnerHtmlTagN,phpInnerHtmlString,htmlArg,phpInnerHtmlValue,phpInnerHtmlTagError,phpInnerHtmlEvent,phpInnerHtmlCssDefinition,@phpInnerHtmlPreproc,@phpInnerHtmlArgCluster
|
||||
syn match phpInnerHtmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,@phpInnerHtmlTagNameCluster
|
||||
syn match phpInnerHtmlTagN contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,htmlSpecialTagName,@phpInnerHtmlTagNameCluster
|
||||
syn match phpInnerHtmlTagError contained "[^>]<"ms=s+1
|
||||
|
||||
|
||||
" special characters
|
||||
syn match phpInnerHtmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
|
||||
|
||||
" Comments (the real ones or the old netscape ones)
|
||||
if exists("html_wrong_comments")
|
||||
syn region phpInnerHtmlComment start=+<!--+ end=+--\s*>+ contains=@Spell
|
||||
else
|
||||
" The HTML 5.2 syntax 8.2.4.41: bogus comment is parser error; browser skips until next >
|
||||
syn region phpInnerHtmlComment start=+<!+ end=+>+ contains=phpInnerHtmlCommentError keepend
|
||||
" Idem 8.2.4.42,51: Comment starts with <!-- and ends with -->
|
||||
" Idem 8.2.4.43,44: Except <!--> and <!---> are parser errors
|
||||
" Idem 8.2.4.52: dash-dash-bang (--!>) is error ignored by parser, also closes comment
|
||||
syn region phpInnerHtmlComment matchgroup=phpInnerHtmlComment start=+<!--\%(-\?>\)\@!+ end=+--!\?>+ contains=phpInnerHtmlCommentNested,@phpInnerHtmlPreProc,@Spell keepend
|
||||
" Idem 8.2.4.49: nested comment is parser error, except <!--> is all right
|
||||
syn match phpInnerHtmlCommentNested contained "<!-->\@!"
|
||||
syn match phpInnerHtmlCommentError contained "[^><!]"
|
||||
endif
|
||||
syn region phpInnerHtmlComment start=+<!DOCTYPE+ end=+>+ keepend
|
||||
|
||||
" server-parsed commands
|
||||
syn region phpInnerHtmlPreProc start=+<!--#+ end=+-->+ contains=phpInnerHtmlPreStmt,phpInnerHtmlPreError,phpInnerHtmlPreAttr
|
||||
syn match phpInnerHtmlPreStmt contained "<!--#\(config\|echo\|exec\|fsize\|flastmod\|include\|printenv\|set\|if\|elif\|else\|endif\|geoguide\)\>"
|
||||
syn match phpInnerHtmlPreError contained "<!--#\S*"ms=s+4
|
||||
syn match phpInnerHtmlPreAttr contained "\w\+=[^"]\S\+" contains=phpInnerHtmlPreProcAttrError,phpInnerHtmlPreProcAttrName
|
||||
syn region phpInnerHtmlPreAttr contained start=+\w\+="+ skip=+\\\\\|\\"+ end=+"+ contains=phpInnerHtmlPreProcAttrName keepend
|
||||
syn match phpInnerHtmlPreProcAttrError contained "\w\+="he=e-1
|
||||
syn match phpInnerHtmlPreProcAttrName contained "\(expr\|errmsg\|sizefmt\|timefmt\|var\|cgi\|cmd\|file\|virtual\|value\)="he=e-1
|
||||
|
||||
if !exists("html_no_rendering")
|
||||
" rendering
|
||||
syn cluster phpInnerHtmlTop contains=@Spell,phpInnerHtmlTag,phpInnerHtmlEndTag,phpInnerHtmlSpecialChar,phpInnerHtmlPreProc,phpInnerHtmlComment,phpInnerHtmlLink,javaScript,@phpInnerHtmlPreproc
|
||||
|
||||
syn region phpInnerHtmlStrike start="<del\>" end="</del\_s*>"me=s-1 contains=@phpInnerHtmlTop
|
||||
syn region phpInnerHtmlStrike start="<strike\>" end="</strike\_s*>"me=s-1 contains=@phpInnerHtmlTop
|
||||
|
||||
syn region phpInnerHtmlBold start="<b\>" end="</b\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlBoldUnderline,phpInnerHtmlBoldItalic
|
||||
syn region phpInnerHtmlBold start="<strong\>" end="</strong\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlBoldUnderline,phpInnerHtmlBoldItalic
|
||||
syn region phpInnerHtmlBoldUnderline contained start="<u\>" end="</u\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlBoldUnderlineItalic
|
||||
syn region phpInnerHtmlBoldItalic contained start="<i\>" end="</i\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlBoldItalicUnderline
|
||||
syn region phpInnerHtmlBoldItalic contained start="<em\>" end="</em\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlBoldItalicUnderline
|
||||
syn region phpInnerHtmlBoldUnderlineItalic contained start="<i\>" end="</i\_s*>"me=s-1 contains=@phpInnerHtmlTop
|
||||
syn region phpInnerHtmlBoldUnderlineItalic contained start="<em\>" end="</em\_s*>"me=s-1 contains=@phpInnerHtmlTop
|
||||
syn region phpInnerHtmlBoldItalicUnderline contained start="<u\>" end="</u\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlBoldUnderlineItalic
|
||||
|
||||
syn region phpInnerHtmlUnderline start="<u\>" end="</u\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlUnderlineBold,phpInnerHtmlUnderlineItalic
|
||||
syn region phpInnerHtmlUnderlineBold contained start="<b\>" end="</b\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlUnderlineBoldItalic
|
||||
syn region phpInnerHtmlUnderlineBold contained start="<strong\>" end="</strong\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlUnderlineBoldItalic
|
||||
syn region phpInnerHtmlUnderlineItalic contained start="<i\>" end="</i\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlUnderlineItalicBold
|
||||
syn region phpInnerHtmlUnderlineItalic contained start="<em\>" end="</em\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlUnderlineItalicBold
|
||||
syn region phpInnerHtmlUnderlineItalicBold contained start="<b\>" end="</b\_s*>"me=s-1 contains=@phpInnerHtmlTop
|
||||
syn region phpInnerHtmlUnderlineItalicBold contained start="<strong\>" end="</strong\_s*>"me=s-1 contains=@phpInnerHtmlTop
|
||||
syn region phpInnerHtmlUnderlineBoldItalic contained start="<i\>" end="</i\_s*>"me=s-1 contains=@phpInnerHtmlTop
|
||||
syn region phpInnerHtmlUnderlineBoldItalic contained start="<em\>" end="</em\_s*>"me=s-1 contains=@phpInnerHtmlTop
|
||||
|
||||
syn region phpInnerHtmlItalic start="<i\>" end="</i\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlItalicBold,phpInnerHtmlItalicUnderline
|
||||
syn region phpInnerHtmlItalic start="<em\>" end="</em\_s*>"me=s-1 contains=@phpInnerHtmlTop
|
||||
syn region phpInnerHtmlItalicBold contained start="<b\>" end="</b\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlItalicBoldUnderline
|
||||
syn region phpInnerHtmlItalicBold contained start="<strong\>" end="</strong\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlItalicBoldUnderline
|
||||
syn region phpInnerHtmlItalicBoldUnderline contained start="<u\>" end="</u\_s*>"me=s-1 contains=@phpInnerHtmlTop
|
||||
syn region phpInnerHtmlItalicUnderline contained start="<u\>" end="</u\_s*>"me=s-1 contains=@phpInnerHtmlTop,phpInnerHtmlItalicUnderlineBold
|
||||
syn region phpInnerHtmlItalicUnderlineBold contained start="<b\>" end="</b\_s*>"me=s-1 contains=@phpInnerHtmlTop
|
||||
syn region phpInnerHtmlItalicUnderlineBold contained start="<strong\>" end="</strong\_s*>"me=s-1 contains=@phpInnerHtmlTop
|
||||
|
||||
syn match phpInnerHtmlLeadingSpace "^\s\+" contained
|
||||
syn region phpInnerHtmlLink start="<a\>\_[^>]*\<href\>" end="</a\_s*>"me=s-1 contains=@Spell,phpInnerHtmlTag,phpInnerHtmlEndTag,phpInnerHtmlSpecialChar,phpInnerHtmlPreProc,phpInnerHtmlComment,phpInnerHtmlLeadingSpace,phpInnerJavaScript,@phpInnerHtmlPreproc
|
||||
syn region phpInnerHtmlH1 start="<h1\>" end="</h1\_s*>"me=s-1 contains=@phpInnerHtmlTop
|
||||
syn region phpInnerHtmlH2 start="<h2\>" end="</h2\_s*>"me=s-1 contains=@phpInnerHtmlTop
|
||||
syn region phpInnerHtmlH3 start="<h3\>" end="</h3\_s*>"me=s-1 contains=@phpInnerHtmlTop
|
||||
syn region phpInnerHtmlH4 start="<h4\>" end="</h4\_s*>"me=s-1 contains=@phpInnerHtmlTop
|
||||
syn region phpInnerHtmlH5 start="<h5\>" end="</h5\_s*>"me=s-1 contains=@phpInnerHtmlTop
|
||||
syn region phpInnerHtmlH6 start="<h6\>" end="</h6\_s*>"me=s-1 contains=@phpInnerHtmlTop
|
||||
syn region phpInnerHtmlHead start="<head\>" end="</head\_s*>"me=s-1 end="<body\>"me=s-1 end="<h[1-6]\>"me=s-1 contains=phpInnerHtmlTag,phpInnerHtmlEndTag,phpInnerHtmlSpecialChar,phpInnerHtmlPreProc,phpInnerHtmlComment,phpInnerHtmlLink,phpInnerHtmlTitle,phpInnerJavaScript,phpInnerCssStyle,@phpInnerHtmlPreproc
|
||||
syn region phpInnerHtmlTitle start="<title\>" end="</title\_s*>"me=s-1 contains=phpInnerHtmlTag,phpInnerHtmlEndTag,phpInnerHtmlSpecialChar,phpInnerHtmlPreProc,phpInnerHtmlComment,phpInnerJavaScript,@phpInnerHtmlPreproc
|
||||
endif
|
||||
|
||||
if main_syntax != 'java' || exists("javascript")
|
||||
" JAVA SCRIPT
|
||||
" For example, $phpVar = '<img onload="foo()" />';
|
||||
syn include @phpInnerHtmlJavaScript syntax/javascript.vim
|
||||
unlet b:current_syntax
|
||||
syn region phpInnerHtmlScriptTag contained start=+<script+ end=+>+ fold contains=phpInnerHtmlTagN,phpInnerHtmlString,phpInnerHtmlArg,phpInnerHtmlValue,phpInnerHtmlTagError,phpInnerHtmlEvent
|
||||
hi def link phpInnerHtmlScriptTag phpInnerHtmlTag
|
||||
|
||||
" phpInnerHtml events (i.e. arguments that include phpInnerJavascript commands)
|
||||
if exists("html_extended_events")
|
||||
syn region phpInnerHtmlEvent contained start=+\<on\a\+\s*=[\t ]*'+ end=+'+ contains=phpInnerHtmlEventSQ
|
||||
syn region phpInnerHtmlEvent contained start=+\<on\a\+\s*=[\t ]*"+ end=+"+ contains=phpInnerHtmlEventDQ
|
||||
else
|
||||
syn region phpInnerHtmlEvent contained start=+\<on\a\+\s*=[\t ]*'+ end=+'+ keepend contains=phpInnerHtmlEventSQ
|
||||
syn region phpInnerHtmlEvent contained start=+\<on\a\+\s*=[\t ]*"+ end=+"+ keepend contains=phpInnerHtmlEventDQ
|
||||
endif
|
||||
syn region phpInnerHtmlEventSQ contained start=+'+ms=s+1 end=+'+me=s-1 contains=@phpInnerHtmlJavaScript
|
||||
syn region phpInnerHtmlEventDQ contained start=+"+ms=s+1 end=+"+me=s-1 contains=@phpInnerHtmlJavaScript
|
||||
hi def link phpInnerHtmlEventSQ phpInnerHtmlEvent
|
||||
hi def link phpInnerHtmlEventDQ phpInnerHtmlEvent
|
||||
|
||||
" a phpInnerJavascript expression is used as an arg value
|
||||
" syn region phpInnerJavaScriptExpression contained start=+&{+ keepend end=+};+ contains=@phpInnerHtmlJavaScript,@phpInnerHtmlPreproc
|
||||
endif
|
||||
|
||||
syn cluster phpInnerHtmlJavaScript add=@phpInnerHtmlPreproc
|
||||
|
||||
" The default highlighting.
|
||||
" NOTE: For now, this deliberately copies the definitions from html rather than link
|
||||
" to the corresponding html tag name. If html is refactored to rename any
|
||||
" keywords then html highlighting would unexpectedly be cleared.
|
||||
hi def link phpInnerHtmlTag Function
|
||||
hi def link phpInnerHtmlEndTag Identifier
|
||||
hi def link phpInnerHtmlArg Type
|
||||
hi def link phpInnerHtmlValue String
|
||||
hi def link phpInnerHtmlSpecialChar Special
|
||||
|
||||
if !exists("html_no_rendering")
|
||||
hi def link phpInnerHtmlH1 Title
|
||||
hi def link phpInnerHtmlH2 phpInnerHtmlH1
|
||||
hi def link phpInnerHtmlH3 phpInnerHtmlH2
|
||||
hi def link phpInnerHtmlH4 phpInnerHtmlH3
|
||||
hi def link phpInnerHtmlH5 phpInnerHtmlH4
|
||||
hi def link phpInnerHtmlH6 phpInnerHtmlH5
|
||||
hi def link phpInnerHtmlHead PreProc
|
||||
hi def link phpInnerHtmlTitle Title
|
||||
hi def link phpInnerHtmlBoldItalicUnderline phpInnerHtmlBoldUnderlineItalic
|
||||
hi def link phpInnerHtmlUnderlineBold phpInnerHtmlBoldUnderline
|
||||
hi def link phpInnerHtmlUnderlineItalicBold phpInnerHtmlBoldUnderlineItalic
|
||||
hi def link phpInnerHtmlUnderlineBoldItalic phpInnerHtmlBoldUnderlineItalic
|
||||
hi def link phpInnerHtmlItalicUnderline phpInnerHtmlUnderlineItalic
|
||||
hi def link phpInnerHtmlItalicBold phpInnerHtmlBoldItalic
|
||||
hi def link phpInnerHtmlItalicBoldUnderline phpInnerHtmlBoldUnderlineItalic
|
||||
hi def link phpInnerHtmlItalicUnderlineBold phpInnerHtmlBoldUnderlineItalic
|
||||
hi def link phpInnerHtmlLink Underlined
|
||||
hi def link phpInnerHtmlLeadingSpace None
|
||||
if !exists("html_my_rendering")
|
||||
hi def phpInnerHtmlBold term=bold cterm=bold gui=bold
|
||||
hi def phpInnerHtmlBoldUnderline term=bold,underline cterm=bold,underline gui=bold,underline
|
||||
hi def phpInnerHtmlBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic
|
||||
hi def phpInnerHtmlBoldUnderlineItalic term=bold,italic,underline cterm=bold,italic,underline gui=bold,italic,underline
|
||||
hi def phpInnerHtmlUnderline term=underline cterm=underline gui=underline
|
||||
hi def phpInnerHtmlUnderlineItalic term=italic,underline cterm=italic,underline gui=italic,underline
|
||||
hi def phpInnerHtmlItalic term=italic cterm=italic gui=italic
|
||||
if v:version > 800 || v:version == 800 && has("patch1038")
|
||||
hi def phpInnerHtmlStrike term=strikethrough cterm=strikethrough gui=strikethrough
|
||||
else
|
||||
hi def phpInnerHtmlStrike term=underline cterm=underline gui=underline
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
hi def link phpInnerHtmlPreStmt PreProc
|
||||
hi def link phpInnerHtmlPreError Error
|
||||
hi def link phpInnerHtmlPreProc PreProc
|
||||
hi def link phpInnerHtmlPreAttr String
|
||||
hi def link phpInnerHtmlPreProcAttrName PreProc
|
||||
hi def link phpInnerHtmlPreProcAttrError Error
|
||||
hi def link phpInnerHtmlString String
|
||||
hi def link phpInnerHtmlStatement Statement
|
||||
hi def link phpInnerHtmlComment Comment
|
||||
hi def link phpInnerHtmlCommentNested phpInnerHtmlError
|
||||
hi def link phpInnerHtmlCommentError phpInnerHtmlError
|
||||
hi def link phpInnerHtmlTagError phpInnerHtmlError
|
||||
hi def link phpInnerHtmlEvent phpInnerJavaScript
|
||||
hi def link phpInnerHtmlError Error
|
||||
|
||||
hi def link phpInnerJavaScript Special
|
||||
hi def link phpInnerJavaScriptExpression phpInnerJavaScript
|
||||
hi def link phpInnerHtmlCssStyleComment Comment
|
||||
hi def link phpInnerHtmlCssDefinition Special
|
||||
endif
|
||||
|
||||
|
||||
runtime! syntax/html.vim
|
||||
unlet b:current_syntax
|
||||
|
||||
@@ -79,6 +309,8 @@ if exists("php_parentError") && !exists("php_parent_error_open") && !exists("php
|
||||
let php_parent_error_open=1
|
||||
endif
|
||||
|
||||
" End of copy of html syntax for embedding in php strings }}}
|
||||
|
||||
syn cluster htmlPreproc add=phpRegion,phpRegionAsp,phpRegionSc
|
||||
|
||||
syn include @sqlTop syntax/sql.vim
|
||||
@@ -90,7 +322,11 @@ if exists( "php_sql_query")
|
||||
endif
|
||||
|
||||
if exists( "php_htmlInStrings")
|
||||
syn cluster phpAddStrings add=@htmlTop
|
||||
if php_htmlInStrings==2
|
||||
syn cluster phpAddStrings add=@phpInnerHtmlTop
|
||||
else
|
||||
syn cluster phpAddStrings add=@htmlTop
|
||||
endif
|
||||
endif
|
||||
|
||||
" make sure we can use \ at the beginning of the line to do a continuation
|
||||
@@ -283,7 +519,7 @@ syn keyword phpStatement return break continue exit goto yield contained
|
||||
syn keyword phpKeyword var const contained
|
||||
|
||||
" Type
|
||||
syn keyword phpType void bool boolean int integer real double float string array object NULL callable iterable mixed contained
|
||||
syn keyword phpType void bool boolean int integer real double float string array object NULL callable iterable mixed never contained
|
||||
|
||||
" Structure
|
||||
syn keyword phpStructure namespace extends implements instanceof parent self contained
|
||||
@@ -361,7 +597,7 @@ syn match phpFloatError "\%([eE.][0-9._+-]*\.\|__\|_\(\>\|[eE]\)\|\(\>\|[eE]\)_\
|
||||
|
||||
" Number
|
||||
syn match phpNumber "\%(\.\)\@<!\<\%([1-9]\d*\|0\|0[xX]\(\x_\?\)*\x\)\>\%(\.\)\@!" contained display
|
||||
syn match phpNumber "\%(\.\)\@<!\<0\d\+\>\%(\.\)\@!" contained contains=phpOctalError display
|
||||
syn match phpNumber "\%(\.\)\@<!\<0\d\+\|0[oO]\d\+\>\%(\.\)\@!" contained contains=phpOctalError display
|
||||
syn match phpBinaryError "[2-9]" contained display
|
||||
syn match phpNumber "\%(\.\)\@<!\<0[bB]\(\d_\?\)*\d\>\%(\.\)\@!" contained contains=phpBinaryError display
|
||||
|
||||
@@ -446,7 +682,7 @@ syn cluster phpClTop contains=@phpClFunction,phpFoldFunction,phpFoldClass,phpFol
|
||||
" Php Region
|
||||
if exists("php_parent_error_open")
|
||||
if exists("php_noShortTags")
|
||||
syn region phpRegion matchgroup=Delimiter start="<?php" end="?>" contains=@phpClTop
|
||||
syn region phpRegion matchgroup=Delimiter start="<?\(php\|=\)" end="?>" contains=@phpClTop
|
||||
else
|
||||
syn region phpRegion matchgroup=Delimiter start="<?\(php\)\=" end="?>" contains=@phpClTop
|
||||
endif
|
||||
@@ -456,7 +692,7 @@ if exists("php_parent_error_open")
|
||||
endif
|
||||
else
|
||||
if exists("php_noShortTags")
|
||||
syn region phpRegion matchgroup=Delimiter start="<?php" end="?>" contains=@phpClTop keepend
|
||||
syn region phpRegion matchgroup=Delimiter start="<?\(php\|=\)" end="?>" contains=@phpClTop keepend
|
||||
else
|
||||
syn region phpRegion matchgroup=Delimiter start="<?\(php\)\=" end="?>" contains=@phpClTop keepend
|
||||
endif
|
||||
@@ -469,13 +705,13 @@ endif
|
||||
" Fold
|
||||
if exists("php_folding") && php_folding==1
|
||||
" match one line constructs here and skip them at folding
|
||||
syn keyword phpSCKeyword abstract final private protected public static contained
|
||||
syn keyword phpSCKeyword abstract final private protected public static readonly contained
|
||||
syn keyword phpFCKeyword function contained
|
||||
syn keyword phpDefine fn contained
|
||||
syn keyword phpStorageClass global contained
|
||||
syn match phpDefine "\(\s\|^\)\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\(\s\+.*[;}]\)\@=" contained contains=phpSCKeyword
|
||||
syn match phpStructure "\(\s\|^\)\(abstract\s\+\|final\s\+\)*\(trait\|class\)\(\s\+.*}\)\@=" contained
|
||||
syn match phpStructure "\(\s\|^\)interface\(\s\+.*}\)\@=" contained
|
||||
syn match phpStructure "\(\s\|^\)\(interface\|enum\)\(\s\+.*}\)\@=" contained
|
||||
syn match phpException "\(\s\|^\)try\(\s\+.*}\)\@=" contained
|
||||
syn match phpException "\(\s\|^\)catch\(\s\+.*}\)\@=" contained
|
||||
syn match phpException "\(\s\|^\)finally\(\s\+.*}\)\@=" contained
|
||||
@@ -484,15 +720,15 @@ if exists("php_folding") && php_folding==1
|
||||
syn region phpFoldHtmlInside matchgroup=Delimiter start="?>" end="<?\(php\)\=" contained transparent contains=@htmlTop
|
||||
syn region phpFoldFunction matchgroup=Storageclass start="^\z(\s*\)\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\s\([^};]*$\)\@="rs=e-9 matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldHtmlInside,phpFCKeyword contained transparent fold extend
|
||||
syn region phpFoldFunction matchgroup=Define start="^function\s\([^};]*$\)\@=" matchgroup=Delimiter end="^}" contains=@phpClFunction,phpFoldHtmlInside contained transparent fold extend
|
||||
syn region phpFoldClass matchgroup=Structure start="^\z(\s*\)\(abstract\s\+\|final\s\+\)*\(trait\|class\)\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction,phpSCKeyword contained transparent fold extend
|
||||
syn region phpFoldClass matchgroup=Structure start="^\z(\s*\)\(abstract\s\+\|final\s\+\)*\(trait\|class\|enum\)\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction,phpSCKeyword contained transparent fold extend
|
||||
syn region phpFoldInterface matchgroup=Structure start="^\z(\s*\)interface\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend
|
||||
syn region phpFoldCatch matchgroup=Exception start="^\z(\s*\)catch\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend
|
||||
syn region phpFoldTry matchgroup=Exception start="^\z(\s*\)try\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend
|
||||
else
|
||||
syn keyword phpDefine function fn contained
|
||||
syn keyword phpStructure abstract class trait interface contained
|
||||
syn keyword phpStructure abstract class trait interface enum contained
|
||||
syn keyword phpException catch throw try finally contained
|
||||
syn keyword phpStorageClass final global private protected public static contained
|
||||
syn keyword phpStorageClass final global private protected public static readonly contained
|
||||
if exists("php_folding") && php_folding==2
|
||||
setlocal foldmethod=syntax
|
||||
syn region phpFoldHtmlInside matchgroup=Delimiter start="?>" end="<?\(php\)\=" contained transparent contains=@htmlTop
|
||||
@@ -512,9 +748,9 @@ syntax keyword phpStructure list contained
|
||||
syntax keyword phpConditional switch contained
|
||||
syntax keyword phpStatement die contained
|
||||
|
||||
" Highlighting for PHP5's user-definable magic class methods
|
||||
" Highlighting for PHP's user-definable magic class methods
|
||||
syntax keyword phpSpecialFunction containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier
|
||||
\ __construct __destruct __call __callStatic __get __set __isset __unset __sleep __wakeup __toString __invoke __set_state __clone __debugInfo
|
||||
\ __construct __destruct __call __callStatic __get __set __isset __unset __sleep __wakeup __toString __invoke __set_state __clone __debugInfo __serialize __unserialize
|
||||
" Highlighting for __autoload slightly different from line above
|
||||
syntax keyword phpSpecialFunction containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar
|
||||
\ __autoload
|
||||
@@ -638,7 +874,7 @@ endif
|
||||
" Sync
|
||||
if php_sync_method==-1
|
||||
if exists("php_noShortTags")
|
||||
syn sync match phpRegionSync grouphere phpRegion "^\s*<?php\s*$"
|
||||
syn sync match phpRegionSync grouphere phpRegion "^\s*<?\(php\|=\)\s*$"
|
||||
else
|
||||
syn sync match phpRegionSync grouphere phpRegion "^\s*<?\(php\)\=\s*$"
|
||||
endif
|
||||
@@ -658,7 +894,7 @@ endif
|
||||
|
||||
syntax match phpDocCustomTags "@[a-zA-Z]*\(\s\+\|\n\|\r\)" containedin=phpComment
|
||||
syntax region phpDocTags start="{@\(example\|id\|internal\|inheritdoc\|link\|source\|toc\|tutorial\)" end="}" containedin=phpComment
|
||||
syntax match phpDocTags "@\(abstract\|access\|author\|category\|copyright\|deprecated\|example\|final\|global\|ignore\|internal\|license\|link\|method\|name\|package\|param\|property\|return\|see\|since\|static\|staticvar\|subpackage\|tutorial\|uses\|var\|version\|contributor\|modified\|filename\|description\|filesource\|throws\)\(\s\+\)\?" containedin=phpComment
|
||||
syntax match phpDocTags "@\(abstract\|access\|api\|author\|category\|copyright\|deprecated\|example\|final\|global\|ignore\|internal\|license\|link\|method\|name\|package\|param\|property\(-write\|-read\)\?\|return\|see\|since\|source\|static\|staticvar\|subpackage\|tutorial\|uses\|used-by\|var\|version\|contributor\|modified\|filename\|description\|filesource\|throws\)\(\s\+\)\?" containedin=phpComment
|
||||
syntax match phpDocTodo "@\(todo\|fixme\|xxx\)\(\s\+\)\?" containedin=phpComment
|
||||
|
||||
" Define the default highlighting.
|
||||
@@ -729,7 +965,6 @@ else
|
||||
hi def link phpIdentifierSimply Identifier
|
||||
endif
|
||||
|
||||
|
||||
let b:current_syntax = "php"
|
||||
|
||||
if main_syntax == 'php'
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: Vim 8.2 script
|
||||
" Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
|
||||
" Last Change: June 20, 2021
|
||||
" Version: 8.2-06
|
||||
" Last Change: September 21, 2021
|
||||
" Version: 8.2-07
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
|
||||
" Automatically generated keyword lists: {{{1
|
||||
|
||||
@@ -78,12 +78,12 @@ syn match vimHLGroup contained "Conceal"
|
||||
syn case match
|
||||
|
||||
" Function Names {{{2
|
||||
syn keyword vimFuncName contained abs argc assert_equal assert_match atan browsedir bufname byteidxcomp charcol ch_evalexpr ch_logfile ch_sendraw complete cos deepcopy echoraw executable expand filereadable flatten fnameescape foldtext function getbufvar getcharsearch getcmdwintype getenv getftype getmarklist getqflist gettabvar getwinpos glob2regpat hasmapto hlexists index inputsave isdirectory job_getchannel job_stop json_encode line listener_flush luaeval mapset matchdelete matchstr mkdir or popup_clear popup_filter_yesno popup_hide popup_notification prevnonblank prompt_setprompt prop_remove prop_type_list pyxeval readdirex reltime remote_peek rename rubyeval screenpos searchdecl serverlist setcharsearch setline setreg sha256 sign_getplaced sign_unplace slice sound_playfile sqrt str2nr strftime strpart submatch synID systemlist taglist term_dumpload term_getcursor term_getstatus term_scrape term_setrestore test_autochdir test_ignore_error test_null_job test_override test_srand_seed timer_start tr undofile visualmode win_execute winheight winnr win_splitmove
|
||||
syn keyword vimFuncName contained acos argidx assert_equalfile assert_nobeep atan2 bufadd bufnr call charidx ch_evalraw ch_open ch_setoptions complete_add cosh delete empty execute expandcmd filewritable flattennew fnamemodify foldtextresult garbagecollect getchangelist getcharstr getcompletion getfontname getimstatus getmatches getreg gettabwinvar getwinposx globpath histadd hlID input inputsecret isinf job_info join keys line2byte listener_remove map match matchend matchstrpos mode pathshorten popup_close popup_findinfo popup_list popup_setoptions printf prop_add prop_type_add pum_getpos rand readfile reltimefloat remote_read repeat screenattr screenrow searchpair setbufline setcmdpos setloclist settabvar shellescape sign_jump sign_unplacelist sort sound_stop srand strcharlen strgetchar strptime substitute synIDattr tabpagebuflist tan term_dumpwrite term_getjob term_gettitle term_sendkeys term_setsize test_feedinput test_null_blob test_null_list test_refcount test_unknown timer_stop trim undotree wildmenumode win_findbuf win_id2tabwin winrestcmd winwidth
|
||||
syn keyword vimFuncName contained add arglistid assert_exception assert_notequal balloon_gettext bufexists bufwinid ceil ch_canread ch_getbufnr ch_read ch_status complete_check count deletebufline environ exepath extend filter float2nr foldclosed foreground get getchar getcmdline getcurpos getfperm getjumplist getmousepos getreginfo gettagstack getwinposy has histdel hostname inputdialog insert islocked job_setoptions js_decode len lispindent localtime maparg matchadd matchfuzzy max mzeval perleval popup_create popup_findpreview popup_locate popup_settext prompt_getprompt prop_clear prop_type_change pumvisible range reduce reltimestr remote_send resolve screenchar screenstring searchpairpos setbufvar setcursorcharpos setmatches settabwinvar shiftwidth sign_place simplify sound_clear spellbadword state strcharpart stridx strridx swapinfo synIDtrans tabpagenr tanh term_getaltscreen term_getline term_gettty term_setansicolors term_start test_garbagecollect_now test_null_channel test_null_partial test_scrollbar test_void timer_stopall trunc uniq winbufnr win_getid win_id2win winrestview wordcount
|
||||
syn keyword vimFuncName contained and argv assert_fails assert_notmatch balloon_show buflisted bufwinnr changenr ch_close ch_getjob ch_readblob cindent complete_info cscope_connection did_filetype escape exists extendnew finddir floor foldclosedend fullcommand getbufinfo getcharmod getcmdpos getcursorcharpos getfsize getline getpid getregtype gettext getwinvar has_key histget iconv inputlist interrupt isnan job_start js_encode libcall list2str log mapcheck matchaddpos matchfuzzypos menu_info nextnonblank popup_atcursor popup_dialog popup_getoptions popup_menu popup_show prompt_setcallback prop_find prop_type_delete py3eval readblob reg_executing remote_expr remote_startserver reverse screenchars search searchpos setcellwidths setenv setpos settagstack sign_define sign_placelist sin soundfold spellsuggest str2float strchars string strtrans swapname synstack tabpagewinnr tempname term_getansicolors term_getscrolled terminalprops term_setapi term_wait test_garbagecollect_soon test_null_dict test_null_string test_setmouse timer_info tolower type values wincol win_gettype winlayout winsaveview writefile
|
||||
syn keyword vimFuncName contained append asin assert_false assert_report balloon_split bufload byte2line char2nr ch_close_in ch_info ch_readraw clearmatches confirm cursor diff_filler eval exp feedkeys findfile fmod foldlevel funcref getbufline getcharpos getcmdtype getcwd getftime getloclist getpos gettabinfo getwininfo glob haslocaldir histnr indent inputrestore invert items job_status json_decode libcallnr listener_add log10 mapnew matcharg matchlist min nr2char popup_beval popup_filter_menu popup_getpos popup_move pow prompt_setinterrupt prop_list prop_type_get pyeval readdir reg_recording remote_foreground remove round screencol searchcount server2client setcharpos setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playevent split str2list strdisplaywidth strlen strwidth synconcealed system tagfiles term_dumpdiff term_getattr term_getsize term_list term_setkill test_alloc_fail test_getvalue test_null_function test_option_not_set test_settime timer_pause toupper typename virtcol windowsversion win_gotoid winline win_screenpos xor
|
||||
syn keyword vimFuncName contained appendbufline assert_beeps assert_inrange assert_true browse bufloaded byteidx charclass chdir ch_log ch_sendexpr col copy debugbreak diff_hlID eventhandler
|
||||
syn keyword vimFuncName contained abs argc assert_equal assert_match atan browsedir bufname byteidxcomp charcol ch_evalexpr ch_logfile ch_sendraw complete cos deepcopy digraph_get environ exepath extend finddir fmod foldtext garbagecollect getchar getcmdpos getcursorcharpos getfsize getline getpid getregtype gettext getwinvar has_key histget iconv inputlist interrupt isnan job_start js_encode libcall list2str log mapcheck matchaddpos matchfuzzypos menu_info nextnonblank popup_atcursor popup_dialog popup_getoptions popup_menu popup_show prompt_setcallback prop_clear prop_type_change pumvisible range reduce reltimestr remote_send resolve screenchar screenstring searchpairpos setbufvar setcursorcharpos setmatches settabwinvar shiftwidth sign_place simplify sound_clear spellbadword state strcharpart stridx strridx swapinfo synIDtrans tabpagenr tanh term_getaltscreen term_getline term_gettty term_setansicolors term_start test_garbagecollect_now test_ignore_error test_null_job test_override test_srand_seed timer_start tr undofile visualmode win_execute winheight winnr win_splitmove
|
||||
syn keyword vimFuncName contained acos argidx assert_equalfile assert_nobeep atan2 bufadd bufnr call charidx ch_evalraw ch_open ch_setoptions complete_add cosh delete digraph_getlist escape exists extendnew findfile fnameescape foldtextresult get getcharmod getcmdtype getcwd getftime getloclist getpos gettabinfo getwininfo glob haslocaldir histnr indent inputrestore invert items job_status json_decode libcallnr listener_add log10 mapnew matcharg matchlist min nr2char popup_beval popup_filter_menu popup_getpos popup_move pow prompt_setinterrupt prop_find prop_type_delete py3eval readblob reg_executing remote_expr remote_startserver reverse screenchars search searchpos setcellwidths setenv setpos settagstack sign_define sign_placelist sin soundfold spellsuggest str2float strchars string strtrans swapname synstack tabpagewinnr tempname term_getansicolors term_getscrolled terminalprops term_setapi term_wait test_garbagecollect_soon test_null_blob test_null_list test_refcount test_unknown timer_stop trim undotree wildmenumode win_findbuf win_id2tabwin winrestcmd winwidth
|
||||
syn keyword vimFuncName contained add arglistid assert_exception assert_notequal balloon_gettext bufexists bufwinid ceil ch_canread ch_getbufnr ch_read ch_status complete_check count deletebufline digraph_set eval exists_compiled feedkeys flatten fnamemodify foreground getbufinfo getcharpos getcmdwintype getenv getftype getmarklist getqflist gettabvar getwinpos glob2regpat hasmapto hlexists index inputsave isdirectory job_getchannel job_stop json_encode line listener_flush luaeval mapset matchdelete matchstr mkdir or popup_clear popup_filter_yesno popup_hide popup_notification prevnonblank prompt_setprompt prop_list prop_type_get pyeval readdir reg_recording remote_foreground remove round screencol searchcount server2client setcharpos setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playevent split str2list strdisplaywidth strlen strwidth synconcealed system tagfiles term_dumpdiff term_getattr term_getsize term_list term_setkill test_alloc_fail test_getvalue test_null_channel test_null_partial test_scrollbar test_void timer_stopall trunc uniq winbufnr win_getid win_id2win winrestview wordcount
|
||||
syn keyword vimFuncName contained and argv assert_fails assert_notmatch balloon_show buflisted bufwinnr changenr ch_close ch_getjob ch_readblob cindent complete_info cscope_connection did_filetype digraph_setlist eventhandler exp filereadable flattennew foldclosed fullcommand getbufline getcharsearch getcompletion getfontname getimstatus getmatches getreg gettabwinvar getwinposx globpath histadd hlID input inputsecret isinf job_info join keys line2byte listener_remove map match matchend matchstrpos mode pathshorten popup_close popup_findinfo popup_list popup_setoptions printf prop_add prop_remove prop_type_list pyxeval readdirex reltime remote_peek rename rubyeval screenpos searchdecl serverlist setcharsearch setline setreg sha256 sign_getplaced sign_unplace slice sound_playfile sqrt str2nr strftime strpart submatch synID systemlist taglist term_dumpload term_getcursor term_getstatus term_scrape term_setrestore test_autochdir test_gui_drop_files test_null_dict test_null_string test_setmouse timer_info tolower type values wincol win_gettype winlayout winsaveview writefile
|
||||
syn keyword vimFuncName contained append asin assert_false assert_report balloon_split bufload byte2line char2nr ch_close_in ch_info ch_readraw clearmatches confirm cursor diff_filler echoraw executable expand filewritable float2nr foldclosedend funcref getbufvar getcharstr getcurpos getfperm getjumplist getmousepos getreginfo gettagstack getwinposy has histdel hostname inputdialog insert islocked job_setoptions js_decode len lispindent localtime maparg matchadd matchfuzzy max mzeval perleval popup_create popup_findpreview popup_locate popup_settext prompt_getprompt prop_add_list prop_type_add pum_getpos rand readfile reltimefloat remote_read repeat screenattr screenrow searchpair setbufline setcmdpos setloclist settabvar shellescape sign_jump sign_unplacelist sort sound_stop srand strcharlen strgetchar strptime substitute synIDattr tabpagebuflist tan term_dumpwrite term_getjob term_gettitle term_sendkeys term_setsize test_feedinput test_gui_mouse_event test_null_function test_option_not_set test_settime timer_pause toupper typename virtcol windowsversion win_gotoid winline win_screenpos xor
|
||||
syn keyword vimFuncName contained appendbufline assert_beeps assert_inrange assert_true browse bufloaded byteidx charclass chdir ch_log ch_sendexpr col copy debugbreak diff_hlID empty execute expandcmd filter floor foldlevel function getchangelist getcmdline
|
||||
|
||||
"--- syntax here and above generated by mkvimvim ---
|
||||
" Special Vim Highlighting (not automatic) {{{1
|
||||
|
||||
@@ -347,25 +347,25 @@ Doubling to operate on a line also works for operators mentioned below.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2 SUMMARY
|
||||
|
||||
1. To delete from the cursor up to the next word type: dw
|
||||
2. To delete from the cursor up to the end of the word type: de
|
||||
3. To delete from the cursor to the end of a line type: d$
|
||||
4. To delete a whole line type: dd
|
||||
|
||||
1. To delete from the cursor up to the next word type: dw
|
||||
2. To delete from the cursor to the end of a line type: d$
|
||||
3. To delete a whole line type: dd
|
||||
|
||||
4. To repeat a motion prepend it with a number: 2w
|
||||
5. The format for a change command is:
|
||||
5. To repeat a motion prepend it with a number: 2w
|
||||
6. The format for a change command is:
|
||||
operator [number] motion
|
||||
where:
|
||||
operator - is what to do, such as d for delete
|
||||
[number] - is an optional count to repeat the motion
|
||||
motion - moves over the text to operate on, such as w (word),
|
||||
$ (to the end of line), etc.
|
||||
e (end of word), $ (end of the line), etc.
|
||||
|
||||
6. To move to the start of the line use a zero: 0
|
||||
7. To move to the start of the line use a zero: 0
|
||||
|
||||
7. To undo previous actions, type: u (lowercase u)
|
||||
8. To undo previous actions, type: u (lowercase u)
|
||||
To undo all the changes on a line, type: U (capital U)
|
||||
To undo the undo's, type: CTRL-R
|
||||
To undo the undo's, type: CTRL-R
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 3.1: THE PUT COMMAND
|
||||
|
||||
@@ -347,25 +347,25 @@ Doubling to operate on a line also works for operators mentioned below.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2 SUMMARY
|
||||
|
||||
1. To delete from the cursor up to the next word type: dw
|
||||
2. To delete from the cursor up to the end of the word type: de
|
||||
3. To delete from the cursor to the end of a line type: d$
|
||||
4. To delete a whole line type: dd
|
||||
|
||||
1. To delete from the cursor up to the next word type: dw
|
||||
2. To delete from the cursor to the end of a line type: d$
|
||||
3. To delete a whole line type: dd
|
||||
|
||||
4. To repeat a motion prepend it with a number: 2w
|
||||
5. The format for a change command is:
|
||||
5. To repeat a motion prepend it with a number: 2w
|
||||
6. The format for a change command is:
|
||||
operator [number] motion
|
||||
where:
|
||||
operator - is what to do, such as d for delete
|
||||
[number] - is an optional count to repeat the motion
|
||||
motion - moves over the text to operate on, such as w (word),
|
||||
$ (to the end of line), etc.
|
||||
e (end of word), $ (end of the line), etc.
|
||||
|
||||
6. To move to the start of the line use a zero: 0
|
||||
7. To move to the start of the line use a zero: 0
|
||||
|
||||
7. To undo previous actions, type: u (lowercase u)
|
||||
8. To undo previous actions, type: u (lowercase u)
|
||||
To undo all the changes on a line, type: U (capital U)
|
||||
To undo the undo's, type: CTRL-R
|
||||
To undo the undo's, type: CTRL-R
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 3.1: THE PUT COMMAND
|
||||
|
||||
@@ -9647,9 +9647,8 @@ f_synIDattr(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
|
||||
if (in_vim9script()
|
||||
&& (check_for_number_arg(argvars, 0) == FAIL
|
||||
|| (check_for_string_arg(argvars, 1) == FAIL
|
||||
|| (argvars[1].v_type != VAR_UNKNOWN
|
||||
&& check_for_opt_string_arg(argvars, 2) == FAIL))))
|
||||
|| check_for_string_arg(argvars, 1) == FAIL
|
||||
|| check_for_opt_string_arg(argvars, 2) == FAIL))
|
||||
return;
|
||||
|
||||
id = (int)tv_get_number(&argvars[0]);
|
||||
|
||||
@@ -338,7 +338,7 @@ readfile(
|
||||
filemess(curbuf, fname, (char_u *)_(msg_is_a_directory), 0);
|
||||
msg_end();
|
||||
msg_scroll = msg_save;
|
||||
return FAIL;
|
||||
return NOTDONE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1333,7 +1333,7 @@ extern char *Version;
|
||||
#if defined(HAVE_DATE_TIME) && defined(VMS) && defined(VAXC)
|
||||
extern char longVersion[];
|
||||
#else
|
||||
EXTERN char *longVersion INIT(= NULL);
|
||||
extern char *longVersion;
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -1945,7 +1945,13 @@ item_compare2(const void *s1, const void *s2)
|
||||
if (res == FAIL)
|
||||
res = ITEM_COMPARE_FAIL;
|
||||
else
|
||||
{
|
||||
res = (int)tv_get_number_chk(&rettv, &sortinfo->item_compare_func_err);
|
||||
if (res > 0)
|
||||
res = 1;
|
||||
else if (res < 0)
|
||||
res = -1;
|
||||
}
|
||||
if (sortinfo->item_compare_func_err)
|
||||
res = ITEM_COMPARE_FAIL; // return value has wrong type
|
||||
clear_tv(&rettv);
|
||||
|
||||
@@ -96,11 +96,11 @@
|
||||
#ifdef SIGHASARG
|
||||
# ifdef SIGHAS3ARGS
|
||||
# define SIGPROTOARG (int, int, struct sigcontext *)
|
||||
# define SIGDEFARG(s) (s, sig2, scont) int s, sig2; struct sigcontext *scont;
|
||||
# define SIGDEFARG(s) (int s, int sig2, struct sigcontext *scont)
|
||||
# define SIGDUMMYARG 0, 0, (struct sigcontext *)0
|
||||
# else
|
||||
# define SIGPROTOARG (int)
|
||||
# define SIGDEFARG(s) (s) int s UNUSED;
|
||||
# define SIGDEFARG(s) (int s UNUSED)
|
||||
# define SIGDUMMYARG 0
|
||||
# endif
|
||||
#else
|
||||
|
||||
46
src/po/es.po
46
src/po/es.po
@@ -16,8 +16,9 @@ msgstr ""
|
||||
"Last-Translator: Omar Campagne <ocampagne@gmail.com>\n"
|
||||
"Language-Team: vim-doc-es http://www.assembla.com/wiki/show/vim-doc-es\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: octect-stream\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
msgid "E82: Cannot allocate any buffer, exiting..."
|
||||
msgstr "E82: No se pudo asignar memoria para ningún búfer, saliendo..."
|
||||
@@ -1209,19 +1210,17 @@ msgstr "E319: Lo siento, esa orden no está disponible en esta versión"
|
||||
msgid "E172: Only one file name allowed"
|
||||
msgstr "E172: Solo se permite un nombre de archivo"
|
||||
|
||||
msgid "1 more file to edit. Quit anyway?"
|
||||
msgstr "Un (1) archivo más para editar. ¿Cerrar de todas formas?"
|
||||
#, c-format
|
||||
msgid "%d more file to edit. Quit anyway?"
|
||||
msgid_plural "%d more files to edit. Quit anyway?"
|
||||
msgstr[0] "Un (%d) archivo más para editar. ¿Cerrar de todas formas?"
|
||||
msgstr[1] "Hay %d archivos más para editar. ¿Cerrar de todas formas?"
|
||||
|
||||
#, c-format
|
||||
msgid "%d more files to edit. Quit anyway?"
|
||||
msgstr "Hay %d archivos más en edición. ¿Cerrar de todas formas?"
|
||||
|
||||
msgid "E173: 1 more file to edit"
|
||||
msgstr "E173: Un (1) archivo más para editar"
|
||||
|
||||
#, c-format
|
||||
msgid "E173: %ld more files to edit"
|
||||
msgstr "E173: Hay %ld archivos en edición"
|
||||
msgid "E173: %d more file to edit"
|
||||
msgid_plural "E173: %d more files to edit"
|
||||
msgstr[0] "E173: Un (%d) archivo más para editar"
|
||||
msgstr[1] "E173: Hay %d archivos más para editar"
|
||||
|
||||
msgid "E174: Command already exists: add ! to replace it"
|
||||
msgstr "E174: Ya existe esa orden. Añada \"!\" para reemplazarla"
|
||||
@@ -3672,24 +3671,17 @@ msgstr " MÁS NUEVO que el archivo de intercambio!\n"
|
||||
# * other languages.
|
||||
msgid ""
|
||||
"\n"
|
||||
"(1) Another program may be editing the same file.\n"
|
||||
" If this is the case, be careful not to end up with two\n"
|
||||
" different instances of the same file when making changes.\n"
|
||||
"(1) Another program may be editing the same file. If this is the case,\n"
|
||||
" be careful not to end up with two different instances of the same\n"
|
||||
" file when making changes. Quit, or continue with caution.\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"(1) Puede que otro programa esté editando el mismo archivo.\n"
|
||||
" De ser así, tenga cuidado de no acabar con dos\n"
|
||||
" ejemplares diferentes del mismo archivo al hacer cambios.\n"
|
||||
"(1) Puede que otro programa esté editando el mismo archivo. De ser así,\n"
|
||||
" tenga cuidado de no acabar con dos ejemplares diferentes del mismo\n"
|
||||
" archivo al hacer cambios. Salga del programa o continúe con precaución.\n"
|
||||
|
||||
msgid " Quit, or continue with caution.\n"
|
||||
msgstr " Salga del programa o continúe con precaución.\n"
|
||||
|
||||
msgid ""
|
||||
"\n"
|
||||
"(2) An edit session for this file crashed.\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"(2) Falló una sesión de edición de este archivo.\n"
|
||||
msgid "(2) An edit session for this file crashed.\n"
|
||||
msgstr "(2) Falló una sesión de edición de este archivo.\n"
|
||||
|
||||
msgid " If this is the case, use \":recover\" or \"vim -r "
|
||||
msgstr " Si es así, use \":recover\" o \"vim -r "
|
||||
|
||||
@@ -2065,6 +2065,8 @@ do_put(
|
||||
}
|
||||
else
|
||||
{
|
||||
linenr_T new_lnum = new_cursor.lnum;
|
||||
|
||||
// Insert at least one line. When y_type is MCHAR, break the first
|
||||
// line in two.
|
||||
for (cnt = 1; cnt <= count; ++cnt)
|
||||
@@ -2085,6 +2087,7 @@ do_put(
|
||||
STRCAT(newp, ptr);
|
||||
// insert second line
|
||||
ml_append(lnum, newp, (colnr_T)0, FALSE);
|
||||
++new_lnum;
|
||||
vim_free(newp);
|
||||
|
||||
oldp = ml_get(lnum);
|
||||
@@ -2103,10 +2106,13 @@ do_put(
|
||||
|
||||
for (; i < y_size; ++i)
|
||||
{
|
||||
if ((y_type != MCHAR || i < y_size - 1)
|
||||
&& ml_append(lnum, y_array[i], (colnr_T)0, FALSE)
|
||||
if (y_type != MCHAR || i < y_size - 1)
|
||||
{
|
||||
if (ml_append(lnum, y_array[i], (colnr_T)0, FALSE)
|
||||
== FAIL)
|
||||
goto error;
|
||||
new_lnum++;
|
||||
}
|
||||
lnum++;
|
||||
++nr_lines;
|
||||
if (flags & PUT_FIXINDENT)
|
||||
@@ -2138,6 +2144,8 @@ do_put(
|
||||
lendiff -= (int)STRLEN(ml_get(lnum));
|
||||
}
|
||||
}
|
||||
if (cnt == 1)
|
||||
new_lnum = lnum;
|
||||
}
|
||||
|
||||
error:
|
||||
@@ -2195,8 +2203,11 @@ error:
|
||||
}
|
||||
else
|
||||
{
|
||||
curwin->w_cursor.lnum = lnum;
|
||||
curwin->w_cursor.lnum = new_lnum;
|
||||
curwin->w_cursor.col = col;
|
||||
curbuf->b_op_end = curwin->w_cursor;
|
||||
if (col > 1)
|
||||
curbuf->b_op_end.col = col - 1;
|
||||
}
|
||||
}
|
||||
else if (y_type == MLINE)
|
||||
|
||||
@@ -2282,11 +2282,7 @@ f_sign_getdefined(typval_T *argvars, typval_T *rettv)
|
||||
return;
|
||||
|
||||
if (argvars[0].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL)
|
||||
return;
|
||||
name = tv_get_string(&argvars[0]);
|
||||
}
|
||||
|
||||
sign_getlist(name, rettv->vval.v_list);
|
||||
}
|
||||
|
||||
@@ -2346,6 +2346,19 @@ func Test_throw_in_BufWritePre()
|
||||
au! throwing
|
||||
endfunc
|
||||
|
||||
func Test_autocmd_in_try_block()
|
||||
call mkdir('Xdir')
|
||||
au BufEnter * let g:fname = expand('%')
|
||||
try
|
||||
edit Xdir/
|
||||
endtry
|
||||
call assert_match('Xdir', g:fname)
|
||||
|
||||
unlet g:fname
|
||||
au! BufEnter
|
||||
call delete('Xdir', 'rf')
|
||||
endfunc
|
||||
|
||||
func Test_autocmd_SafeState()
|
||||
CheckRunVimInTerminal
|
||||
|
||||
|
||||
@@ -663,10 +663,11 @@ func Test_list2blob()
|
||||
\ [[0], 0z00],
|
||||
\ [[], 0z],
|
||||
\ [[0, 0, 0, 0], 0z00000000],
|
||||
\ [[255, 255], 0zFFFF],
|
||||
\ [[170, 187, 204, 221], 0zAABB.CCDD],
|
||||
\ ]
|
||||
for t in tests
|
||||
call assert_equal(t[0]->list2blob(), t[1])
|
||||
call assert_equal(t[1], t[0]->list2blob())
|
||||
endfor
|
||||
call assert_fails('let b = list2blob([1, []])', 'E745:')
|
||||
call assert_fails('let b = list2blob([-1])', 'E1239:')
|
||||
|
||||
@@ -59,7 +59,7 @@ let s:filename_checks = {
|
||||
\ 'aml': ['file.aml'],
|
||||
\ 'ampl': ['file.run'],
|
||||
\ 'ant': ['build.xml'],
|
||||
\ 'apache': ['.htaccess', '/etc/httpd/file.conf', '/etc/apache2/sites-2/file.com', '/etc/apache2/some.config', '/etc/apache2/conf.file/conf', '/etc/apache2/mods-some/file', '/etc/apache2/sites-some/file', '/etc/httpd/conf.d/file.config', '/etc/apache2/conf.file/file', '/etc/apache2/file.conf', '/etc/apache2/file.conf-file', '/etc/apache2/mods-file/file', '/etc/apache2/sites-file/file', '/etc/apache2/sites-file/file.com', '/etc/httpd/conf.d/file.conf', '/etc/httpd/conf.d/file.conf-file', 'access.conf', 'access.conf-file', 'any/etc/apache2/conf.file/file', 'any/etc/apache2/file.conf', 'any/etc/apache2/file.conf-file', 'any/etc/apache2/mods-file/file', 'any/etc/apache2/sites-file/file', 'any/etc/apache2/sites-file/file.com', 'any/etc/httpd/conf.d/file.conf', 'any/etc/httpd/conf.d/file.conf-file', 'any/etc/httpd/file.conf', 'apache.conf', 'apache.conf-file', 'apache2.conf', 'apache2.conf-file', 'httpd.conf', 'httpd.conf-file', 'srm.conf', 'srm.conf-file'],
|
||||
\ 'apache': ['.htaccess', '/etc/httpd/file.conf', '/etc/apache2/sites-2/file.com', '/etc/apache2/some.config', '/etc/apache2/conf.file/conf', '/etc/apache2/mods-some/file', '/etc/apache2/sites-some/file', '/etc/httpd/conf.d/file.config', '/etc/apache2/conf.file/file', '/etc/apache2/file.conf', '/etc/apache2/file.conf-file', '/etc/apache2/mods-file/file', '/etc/apache2/sites-file/file', '/etc/apache2/sites-file/file.com', '/etc/httpd/conf.d/file.conf', '/etc/httpd/conf.d/file.conf-file', 'access.conf', 'access.conf-file', 'any/etc/apache2/conf.file/file', 'any/etc/apache2/file.conf', 'any/etc/apache2/file.conf-file', 'any/etc/apache2/mods-file/file', 'any/etc/apache2/sites-file/file', 'any/etc/apache2/sites-file/file.com', 'any/etc/httpd/conf.d/file.conf', 'any/etc/httpd/conf.d/file.conf-file', 'any/etc/httpd/file.conf', 'apache.conf', 'apache.conf-file', 'apache2.conf', 'apache2.conf-file', 'httpd.conf', 'httpd.conf-file', 'srm.conf', 'srm.conf-file', '/etc/httpd/mods-some/file', '/etc/httpd/sites-some/file', '/etc/httpd/conf.file/conf'],
|
||||
\ 'apachestyle': ['/etc/proftpd/file.config,/etc/proftpd/conf.file/file', '/etc/proftpd/conf.file/file', '/etc/proftpd/file.conf', '/etc/proftpd/file.conf-file', 'any/etc/proftpd/conf.file/file', 'any/etc/proftpd/file.conf', 'any/etc/proftpd/file.conf-file', 'proftpd.conf', 'proftpd.conf-file'],
|
||||
\ 'applescript': ['file.scpt'],
|
||||
\ 'aptconf': ['apt.conf', '/.aptitude/config', 'any/.aptitude/config'],
|
||||
@@ -142,7 +142,7 @@ let s:filename_checks = {
|
||||
\ 'desc': ['file.desc'],
|
||||
\ 'desktop': ['file.desktop', '.directory', 'file.directory'],
|
||||
\ 'dictconf': ['dict.conf', '.dictrc'],
|
||||
\ 'dictdconf': ['dictd.conf'],
|
||||
\ 'dictdconf': ['dictd.conf', 'dictdfile.conf', 'dictd-file.conf'],
|
||||
\ 'diff': ['file.diff', 'file.rej'],
|
||||
\ 'dircolors': ['.dir_colors', '.dircolors', '/etc/DIR_COLORS', 'any/etc/DIR_COLORS'],
|
||||
\ 'dnsmasq': ['/etc/dnsmasq.conf', '/etc/dnsmasq.d/file', 'any/etc/dnsmasq.conf', 'any/etc/dnsmasq.d/file'],
|
||||
@@ -551,7 +551,7 @@ let s:filename_checks = {
|
||||
\ 'xhtml': ['file.xhtml', 'file.xht'],
|
||||
\ 'xinetd': ['/etc/xinetd.conf', '/etc/xinetd.d/file', 'any/etc/xinetd.conf', 'any/etc/xinetd.d/file'],
|
||||
\ 'xmath': ['file.msc', 'file.msf'],
|
||||
\ 'xml': ['/etc/blkid.tab', '/etc/blkid.tab.old', 'file.xmi', 'file.csproj', 'file.csproj.user', 'file.ui', 'file.tpm', '/etc/xdg/menus/file.menu', 'fglrxrc', 'file.xlf', 'file.xliff', 'file.xul', 'file.wsdl', 'file.wpl', 'any/etc/blkid.tab', 'any/etc/blkid.tab.old', 'any/etc/xdg/menus/file.menu', 'file.atom', 'file.rss', 'file.cdxml', 'file.psc1'],
|
||||
\ 'xml': ['/etc/blkid.tab', '/etc/blkid.tab.old', 'file.xmi', 'file.csproj', 'file.csproj.user', 'file.ui', 'file.tpm', '/etc/xdg/menus/file.menu', 'fglrxrc', 'file.xlf', 'file.xliff', 'file.xul', 'file.wsdl', 'file.wpl', 'any/etc/blkid.tab', 'any/etc/blkid.tab.old', 'any/etc/xdg/menus/file.menu', 'file.atom', 'file.rss', 'file.cdxml', 'file.psc1', 'file.mpd'],
|
||||
\ 'xmodmap': ['anyXmodmap', 'Xmodmap', 'some-Xmodmap', 'some-xmodmap', 'some-xmodmap-file', 'xmodmap', 'xmodmap-file'],
|
||||
\ 'xf86conf': ['xorg.conf', 'xorg.conf-4'],
|
||||
\ 'xpm2': ['file.xpm2'],
|
||||
|
||||
@@ -122,4 +122,16 @@ func Test_put_visual_delete_all_lines()
|
||||
close!
|
||||
endfunc
|
||||
|
||||
func Test_gp_with_count_leaves_cursor_at_end()
|
||||
new
|
||||
call setline(1, '<---->')
|
||||
call setreg('@', "foo\nbar", 'c')
|
||||
normal 1G3|3gp
|
||||
call assert_equal([0, 4, 4, 0], getpos("."))
|
||||
call assert_equal(['<--foo', 'barfoo', 'barfoo', 'bar-->'], getline(1, '$'))
|
||||
call assert_equal([0, 4, 3, 0], getpos("']"))
|
||||
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
@@ -58,6 +58,7 @@ endfunc
|
||||
func Test_sort_numbers()
|
||||
call assert_equal([3, 13, 28], sort([13, 28, 3], 'N'))
|
||||
call assert_equal(['3', '13', '28'], sort(['13', '28', '3'], 'N'))
|
||||
call assert_equal([3997, 4996], sort([4996, 3997], 'Compare1'))
|
||||
endfunc
|
||||
|
||||
func Test_sort_float()
|
||||
|
||||
@@ -2236,7 +2236,7 @@ func Test_user_command_throw_in_function_call()
|
||||
catch /my_error/
|
||||
let caught = 'yes'
|
||||
catch
|
||||
let caught = 'no'
|
||||
let caught = v:exception
|
||||
endtry
|
||||
call assert_equal('yes', caught)
|
||||
END
|
||||
@@ -2247,6 +2247,32 @@ func Test_user_command_throw_in_function_call()
|
||||
unlet g:caught
|
||||
endfunc
|
||||
|
||||
" Test for using throw in a called function with following endtry {{{1
|
||||
func Test_user_command_function_call_with_endtry()
|
||||
let lines =<< trim END
|
||||
funct s:throw(msg) abort
|
||||
throw a:msg
|
||||
endfunc
|
||||
func s:main() abort
|
||||
try
|
||||
try
|
||||
throw 'err1'
|
||||
catch
|
||||
call s:throw('err2') | endtry
|
||||
catch
|
||||
let s:caught = 'yes'
|
||||
endtry
|
||||
endfunc
|
||||
|
||||
call s:main()
|
||||
call assert_equal('yes', s:caught)
|
||||
END
|
||||
call writefile(lines, 'XtestThrow')
|
||||
source XtestThrow
|
||||
|
||||
call delete('XtestThrow')
|
||||
endfunc
|
||||
|
||||
|
||||
" Modeline {{{1
|
||||
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
|
||||
|
||||
@@ -380,12 +380,14 @@ enddef
|
||||
def Test_byte2line()
|
||||
CheckDefAndScriptFailure2(['byte2line("1")'], 'E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1')
|
||||
CheckDefAndScriptFailure2(['byte2line([])'], 'E1013: Argument 1: type mismatch, expected number but got list<unknown>', 'E1210: Number required for argument 1')
|
||||
assert_equal(-1, byte2line(0))
|
||||
byte2line(0)->assert_equal(-1)
|
||||
enddef
|
||||
|
||||
def Test_byteidx()
|
||||
CheckDefAndScriptFailure2(['byteidx(1, 2)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['byteidx("a", "b")'], 'E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2')
|
||||
byteidx('', 0)->assert_equal(0)
|
||||
byteidx('', 1)->assert_equal(-1)
|
||||
enddef
|
||||
|
||||
def Test_byteidxcomp()
|
||||
@@ -581,6 +583,7 @@ enddef
|
||||
|
||||
def Test_charclass()
|
||||
assert_fails('charclass(true)', 'E1174:')
|
||||
charclass('')->assert_equal(0)
|
||||
enddef
|
||||
|
||||
def Test_charcol()
|
||||
@@ -600,6 +603,8 @@ def Test_charidx()
|
||||
CheckDefAndScriptFailure2(['charidx(0z10, 1)'], 'E1013: Argument 1: type mismatch, expected string but got blob', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['charidx("a", "b")'], 'E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2')
|
||||
CheckDefAndScriptFailure2(['charidx("a", 1, "")'], 'E1013: Argument 3: type mismatch, expected bool but got string', 'E1212: Bool required for argument 3')
|
||||
charidx('', 0)->assert_equal(-1)
|
||||
charidx('', 1)->assert_equal(-1)
|
||||
enddef
|
||||
|
||||
def Test_chdir()
|
||||
@@ -896,6 +901,7 @@ def Test_expand()
|
||||
CheckDefAndScriptFailure2(['expand(1)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['expand("a", 2)'], 'E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2')
|
||||
CheckDefAndScriptFailure2(['expand("a", true, 2)'], 'E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3')
|
||||
expand('')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_expandcmd()
|
||||
@@ -903,6 +909,7 @@ def Test_expandcmd()
|
||||
assert_equal("blue sky", expandcmd("`=$FOO .. ' sky'`"))
|
||||
|
||||
assert_equal("yes", expandcmd("`={a: 'yes'}['a']`"))
|
||||
expandcmd('')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_extend_arg_types()
|
||||
@@ -1081,6 +1088,7 @@ def Test_finddir()
|
||||
CheckDefExecFailure(['echo finddir("")'], 'E1175:')
|
||||
CheckDefAndScriptFailure2(['finddir("a", [])'], 'E1013: Argument 2: type mismatch, expected string but got list<unknown>', 'E1174: String required for argument 2')
|
||||
CheckDefAndScriptFailure2(['finddir("a", "b", "c")'], 'E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3')
|
||||
finddir('abc', '')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_findfile()
|
||||
@@ -1095,6 +1103,7 @@ def Test_findfile()
|
||||
CheckDefExecFailure(['findfile("")'], 'E1175:')
|
||||
CheckDefAndScriptFailure2(['findfile("a", [])'], 'E1013: Argument 2: type mismatch, expected string but got list<unknown>', 'E1174: String required for argument 2')
|
||||
CheckDefAndScriptFailure2(['findfile("a", "b", "c")'], 'E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3')
|
||||
findfile('abc', '')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_flatten()
|
||||
@@ -1183,6 +1192,7 @@ enddef
|
||||
def Test_fnameescape()
|
||||
CheckDefAndScriptFailure2(['fnameescape(10)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
assert_equal('\+a\%b\|', fnameescape('+a%b|'))
|
||||
fnameescape('')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_fnamemodify()
|
||||
@@ -1275,6 +1285,7 @@ def Test_fullcommand()
|
||||
assert_equal('srewind', fullcommand('sre'))
|
||||
assert_equal('scriptnames', fullcommand('scr'))
|
||||
assert_equal('', fullcommand('scg'))
|
||||
fullcommand('')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_funcref()
|
||||
@@ -1416,10 +1427,12 @@ def Test_getenv()
|
||||
$SOMEENVVAR = 'some'
|
||||
assert_equal('some', getenv('SOMEENVVAR'))
|
||||
unlet $SOMEENVVAR
|
||||
getenv('')->assert_equal(v:null)
|
||||
enddef
|
||||
|
||||
def Test_getfontname()
|
||||
CheckDefAndScriptFailure2(['getfontname(10)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
#getfontname('')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_getfperm()
|
||||
@@ -1533,6 +1546,8 @@ def Test_getreg()
|
||||
CheckDefAndScriptFailure2(['getreg(1)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['getreg(".", 2)'], 'E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2')
|
||||
CheckDefAndScriptFailure2(['getreg(".", 1, "b")'], 'E1013: Argument 3: type mismatch, expected bool but got string', 'E1212: Bool required for argument 3')
|
||||
@" = 'A1B2C3'
|
||||
getreg('')->assert_equal('A1B2C3')
|
||||
enddef
|
||||
|
||||
def Test_getreg_return_type()
|
||||
@@ -1546,6 +1561,8 @@ def Test_getreginfo()
|
||||
setreg('a', text)
|
||||
getreginfo('a')->assert_equal({regcontents: [text], regtype: 'v', isunnamed: false})
|
||||
assert_fails('getreginfo("ab")', 'E1162:')
|
||||
@" = 'D1E2F3'
|
||||
getreginfo('').regcontents->assert_equal(['D1E2F3'])
|
||||
enddef
|
||||
|
||||
def Test_getregtype()
|
||||
@@ -1553,6 +1570,8 @@ def Test_getregtype()
|
||||
setreg('a', lines)
|
||||
getregtype('a')->assert_equal('V')
|
||||
assert_fails('getregtype("ab")', 'E1162:')
|
||||
setreg('"', 'ABCD', 'b')
|
||||
getregtype('')->assert_equal("\<C-V>4")
|
||||
enddef
|
||||
|
||||
def Test_gettabinfo()
|
||||
@@ -1578,6 +1597,7 @@ def Test_gettext()
|
||||
CheckDefAndScriptFailure2(['gettext(10)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefExecAndScriptFailure(['gettext("")'], 'E475: Invalid argument')
|
||||
assert_equal('abc', gettext("abc"))
|
||||
assert_fails('gettext("")', 'E475:')
|
||||
enddef
|
||||
|
||||
def Test_getwininfo()
|
||||
@@ -1599,11 +1619,12 @@ def Test_glob()
|
||||
CheckDefAndScriptFailure2(['glob("a", 2)'], 'E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2')
|
||||
CheckDefAndScriptFailure2(['glob("a", 1, "b")'], 'E1013: Argument 3: type mismatch, expected bool but got string', 'E1212: Bool required for argument 3')
|
||||
CheckDefAndScriptFailure2(['glob("a", 1, true, 2)'], 'E1013: Argument 4: type mismatch, expected bool but got number', 'E1212: Bool required for argument 4')
|
||||
glob('')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_glob2regpat()
|
||||
CheckDefAndScriptFailure2(['glob2regpat(null)'], 'E1013: Argument 1: type mismatch, expected string but got special', 'E1174: String required for argument 1')
|
||||
assert_equal('^$', glob2regpat(''))
|
||||
glob2regpat('')->assert_equal('^$')
|
||||
enddef
|
||||
|
||||
def Test_globpath()
|
||||
@@ -1613,12 +1634,14 @@ def Test_globpath()
|
||||
CheckDefAndScriptFailure2(['globpath("a", "b", "c")'], 'E1013: Argument 3: type mismatch, expected bool but got string', 'E1212: Bool required for argument 3')
|
||||
CheckDefAndScriptFailure2(['globpath("a", "b", true, "d")'], 'E1013: Argument 4: type mismatch, expected bool but got string', 'E1212: Bool required for argument 4')
|
||||
CheckDefAndScriptFailure2(['globpath("a", "b", true, false, "e")'], 'E1013: Argument 5: type mismatch, expected bool but got string', 'E1212: Bool required for argument 5')
|
||||
globpath('', '')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_has()
|
||||
has('eval', true)->assert_equal(1)
|
||||
CheckDefAndScriptFailure2(['has(["a"])'], 'E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['has("a", "b")'], 'E1013: Argument 2: type mismatch, expected bool but got string', 'E1212: Bool required for argument 2')
|
||||
has('')->assert_equal(0)
|
||||
enddef
|
||||
|
||||
def Test_has_key()
|
||||
@@ -1646,6 +1669,7 @@ def Test_hasmapto()
|
||||
CheckDefAndScriptFailure2(['hasmapto(1, "b")'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['hasmapto("a", 2)'], 'E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2')
|
||||
CheckDefAndScriptFailure2(['hasmapto("a", "b", 2)'], 'E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3')
|
||||
hasmapto('', '')->assert_equal(0)
|
||||
enddef
|
||||
|
||||
def Test_histadd()
|
||||
@@ -1675,11 +1699,13 @@ enddef
|
||||
def Test_hlID()
|
||||
CheckDefAndScriptFailure2(['hlID(10)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
assert_equal(0, hlID('NonExistingHighlight'))
|
||||
hlID('')->assert_equal(0)
|
||||
enddef
|
||||
|
||||
def Test_hlexists()
|
||||
CheckDefAndScriptFailure2(['hlexists([])'], 'E1013: Argument 1: type mismatch, expected string but got list<unknown>', 'E1174: String required for argument 1')
|
||||
assert_equal(0, hlexists('NonExistingHighlight'))
|
||||
hlexists('')->assert_equal(0)
|
||||
enddef
|
||||
|
||||
def Test_iconv()
|
||||
@@ -1687,6 +1713,7 @@ def Test_iconv()
|
||||
CheckDefAndScriptFailure2(['iconv("abc", 10, "to")'], 'E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2')
|
||||
CheckDefAndScriptFailure2(['iconv("abc", "from", 20)'], 'E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3')
|
||||
assert_equal('abc', iconv('abc', 'fromenc', 'toenc'))
|
||||
iconv('', '', '')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_indent()
|
||||
@@ -1783,6 +1810,7 @@ enddef
|
||||
def Test_isdirectory()
|
||||
CheckDefAndScriptFailure2(['isdirectory(1.1)'], 'E1013: Argument 1: type mismatch, expected string but got float', 'E1174: String required for argument 1')
|
||||
assert_false(isdirectory('NonExistingDir'))
|
||||
assert_false(isdirectory(''))
|
||||
enddef
|
||||
|
||||
def Test_islocked()
|
||||
@@ -1793,6 +1821,7 @@ def Test_islocked()
|
||||
lockvar g:v1
|
||||
assert_true(islocked('g:v1'))
|
||||
unlet g:v1
|
||||
islocked('')->assert_equal(-1)
|
||||
enddef
|
||||
|
||||
def Test_items()
|
||||
@@ -1862,16 +1891,19 @@ enddef
|
||||
def Test_join()
|
||||
CheckDefAndScriptFailure2(['join("abc")'], 'E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1211: List required for argument 1')
|
||||
CheckDefAndScriptFailure2(['join([], 2)'], 'E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2')
|
||||
join([''], '')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_js_decode()
|
||||
CheckDefAndScriptFailure2(['js_decode(10)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
assert_equal([1, 2], js_decode('[1,2]'))
|
||||
js_decode('')->assert_equal(v:none)
|
||||
enddef
|
||||
|
||||
def Test_json_decode()
|
||||
CheckDefAndScriptFailure2(['json_decode(true)'], 'E1013: Argument 1: type mismatch, expected string but got bool', 'E1174: String required for argument 1')
|
||||
assert_equal(1.0, json_decode('1.0'))
|
||||
json_decode('')->assert_equal(v:none)
|
||||
enddef
|
||||
|
||||
def Test_keys()
|
||||
@@ -1963,11 +1995,14 @@ def Test_listener_remove()
|
||||
CheckDefAndScriptFailure2(['listener_remove("x")'], 'E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1')
|
||||
enddef
|
||||
|
||||
def Test_lua()
|
||||
def Test_luaeval()
|
||||
if !has('lua')
|
||||
CheckFeature lua
|
||||
endif
|
||||
CheckDefAndScriptFailure2(['luaeval(10)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
if exists_compiled('*luaeval')
|
||||
luaeval('')->assert_equal(v:null)
|
||||
endif
|
||||
enddef
|
||||
|
||||
def Test_map()
|
||||
@@ -2065,6 +2100,7 @@ def Test_maparg()
|
||||
CheckDefAndScriptFailure2(['maparg("a", 2)'], 'E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2')
|
||||
CheckDefAndScriptFailure2(['maparg("a", "b", 2)'], 'E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3')
|
||||
CheckDefAndScriptFailure2(['maparg("a", "b", true, 2)'], 'E1013: Argument 4: type mismatch, expected bool but got number', 'E1212: Bool required for argument 4')
|
||||
maparg('')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_maparg_mapset()
|
||||
@@ -2082,6 +2118,8 @@ def Test_mapcheck()
|
||||
CheckDefAndScriptFailure2(['mapcheck(1)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['mapcheck("a", 2)'], 'E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2')
|
||||
CheckDefAndScriptFailure2(['mapcheck("a", "b", 2)'], 'E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3')
|
||||
mapcheck('')->assert_equal('')
|
||||
mapcheck('', '')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_mapnew()
|
||||
@@ -2108,6 +2146,9 @@ def Test_match()
|
||||
assert_equal(-1, match(['a', 'b', 'c'], 'd'))
|
||||
assert_equal(3, match(['a', 'b', 'c', 'b', 'd', 'b'], 'b', 2))
|
||||
assert_equal(5, match(['a', 'b', 'c', 'b', 'd', 'b'], 'b', 2, 2))
|
||||
match('', 'a')->assert_equal(-1)
|
||||
match('abc', '')->assert_equal(0)
|
||||
match('', '')->assert_equal(0)
|
||||
enddef
|
||||
|
||||
def Test_matchadd()
|
||||
@@ -2152,18 +2193,23 @@ def Test_matchend()
|
||||
assert_equal(-1, matchend(['a', 'b', 'c'], 'd'))
|
||||
assert_equal(3, matchend(['a', 'b', 'c', 'b', 'd', 'b'], 'b', 2))
|
||||
assert_equal(5, matchend(['a', 'b', 'c', 'b', 'd', 'b'], 'b', 2, 2))
|
||||
matchend('', 'a')->assert_equal(-1)
|
||||
matchend('abc', '')->assert_equal(0)
|
||||
matchend('', '')->assert_equal(0)
|
||||
enddef
|
||||
|
||||
def Test_matchfuzzy()
|
||||
CheckDefAndScriptFailure2(['matchfuzzy({}, "p")'], 'E1013: Argument 1: type mismatch, expected list<any> but got dict<unknown>', 'E1211: List required for argument 1')
|
||||
CheckDefAndScriptFailure2(['matchfuzzy([], 1)'], 'E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2')
|
||||
CheckDefAndScriptFailure2(['matchfuzzy([], "a", [])'], 'E1013: Argument 3: type mismatch, expected dict<any> but got list<unknown>', 'E1206: Dictionary required for argument 3')
|
||||
matchfuzzy(['abc', 'xyz'], '')->assert_equal([])
|
||||
enddef
|
||||
|
||||
def Test_matchfuzzypos()
|
||||
CheckDefAndScriptFailure2(['matchfuzzypos({}, "p")'], 'E1013: Argument 1: type mismatch, expected list<any> but got dict<unknown>', 'E1211: List required for argument 1')
|
||||
CheckDefAndScriptFailure2(['matchfuzzypos([], 1)'], 'E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2')
|
||||
CheckDefAndScriptFailure2(['matchfuzzypos([], "a", [])'], 'E1013: Argument 3: type mismatch, expected dict<any> but got list<unknown>', 'E1206: Dictionary required for argument 3')
|
||||
matchfuzzypos(['abc', 'xyz'], '')->assert_equal([[], [], []])
|
||||
enddef
|
||||
|
||||
def Test_matchlist()
|
||||
@@ -2182,6 +2228,9 @@ def Test_matchlist()
|
||||
assert_equal([], matchlist(['a', 'b', 'c'], 'd'))
|
||||
assert_equal(l, matchlist(['a', 'b', 'c', 'b', 'd', 'b'], 'b', 2))
|
||||
assert_equal(l, matchlist(['a', 'b', 'c', 'b', 'd', 'b'], 'b', 2, 2))
|
||||
matchlist('', 'a')->assert_equal([])
|
||||
matchlist('abc', '')->assert_equal(repeat([''], 10))
|
||||
matchlist('', '')->assert_equal(repeat([''], 10))
|
||||
enddef
|
||||
|
||||
def Test_matchstr()
|
||||
@@ -2197,6 +2246,9 @@ def Test_matchstr()
|
||||
assert_equal('', matchstr(['a', 'b', 'c'], 'd'))
|
||||
assert_equal('b', matchstr(['a', 'b', 'c', 'b', 'd', 'b'], 'b', 2))
|
||||
assert_equal('b', matchstr(['a', 'b', 'c', 'b', 'd', 'b'], 'b', 2, 2))
|
||||
matchstr('', 'a')->assert_equal('')
|
||||
matchstr('abc', '')->assert_equal('')
|
||||
matchstr('', '')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_matchstrpos()
|
||||
@@ -2214,6 +2266,9 @@ def Test_matchstrpos()
|
||||
matchstrpos(['a', 'b', 'c', 'b', 'd', 'b'], 'b', 2))
|
||||
assert_equal(['b', 5, 0, 1],
|
||||
matchstrpos(['a', 'b', 'c', 'b', 'd', 'b'], 'b', 2, 2))
|
||||
matchstrpos('', 'a')->assert_equal(['', -1, -1])
|
||||
matchstrpos('abc', '')->assert_equal(['', 0, 0])
|
||||
matchstrpos('', '')->assert_equal(['', 0, 0])
|
||||
enddef
|
||||
|
||||
def Test_max()
|
||||
@@ -2257,6 +2312,7 @@ def Test_mkdir()
|
||||
CheckDefAndScriptFailure2(['mkdir(["a"])'], 'E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['mkdir("a", {})'], 'E1013: Argument 2: type mismatch, expected string but got dict<unknown>', 'E1174: String required for argument 2')
|
||||
CheckDefAndScriptFailure2(['mkdir("a", "b", "c")'], 'E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3')
|
||||
CheckDefExecAndScriptFailure(['mkdir("")'], 'E1175: Non-empty string required for argument 1')
|
||||
delete('a', 'rf')
|
||||
enddef
|
||||
|
||||
@@ -2292,6 +2348,7 @@ enddef
|
||||
def Test_pathshorten()
|
||||
CheckDefAndScriptFailure2(['pathshorten(1)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['pathshorten("a", "x")'], 'E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2')
|
||||
pathshorten('')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_perleval()
|
||||
@@ -2342,6 +2399,9 @@ enddef
|
||||
def Test_popup_filter_menu()
|
||||
CheckDefAndScriptFailure2(['popup_filter_menu("x", "")'], 'E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1')
|
||||
CheckDefAndScriptFailure2(['popup_filter_menu(1, 1)'], 'E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2')
|
||||
var id: number = popup_menu(["one", "two", "three"], {})
|
||||
popup_filter_menu(id, '')
|
||||
popup_close(id)
|
||||
enddef
|
||||
|
||||
def Test_popup_filter_yesno()
|
||||
@@ -2466,6 +2526,7 @@ def Test_prop_find()
|
||||
CheckDefAndScriptFailure2(['prop_find([1, 2])'], 'E1013: Argument 1: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 1')
|
||||
CheckDefAndScriptFailure2(['prop_find([1, 2], "k")'], 'E1013: Argument 1: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 1')
|
||||
CheckDefAndScriptFailure2(['prop_find({"a": 10}, ["a"])'], 'E1013: Argument 2: type mismatch, expected string but got list<string>', 'E1174: String required for argument 2')
|
||||
assert_fails("prop_find({}, '')", 'E474:')
|
||||
enddef
|
||||
|
||||
def Test_prop_list()
|
||||
@@ -2482,23 +2543,27 @@ enddef
|
||||
def Test_prop_type_add()
|
||||
CheckDefAndScriptFailure2(['prop_type_add({"a": 10}, "b")'], 'E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['prop_type_add("a", "b")'], 'E1013: Argument 2: type mismatch, expected dict<any> but got string', 'E1206: Dictionary required for argument 2')
|
||||
assert_fails("prop_type_add('', {highlight: 'Search'})", 'E474:')
|
||||
enddef
|
||||
|
||||
def Test_prop_type_change()
|
||||
CheckDefAndScriptFailure2(['prop_type_change({"a": 10}, "b")'], 'E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['prop_type_change("a", "b")'], 'E1013: Argument 2: type mismatch, expected dict<any> but got string', 'E1206: Dictionary required for argument 2')
|
||||
assert_fails("prop_type_change('', {highlight: 'Search'})", 'E474:')
|
||||
enddef
|
||||
|
||||
def Test_prop_type_delete()
|
||||
CheckDefAndScriptFailure2(['prop_type_delete({"a": 10})'], 'E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['prop_type_delete({"a": 10}, "b")'], 'E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['prop_type_delete("a", "b")'], 'E1013: Argument 2: type mismatch, expected dict<any> but got string', 'E1206: Dictionary required for argument 2')
|
||||
assert_fails("prop_type_delete('')", 'E474:')
|
||||
enddef
|
||||
|
||||
def Test_prop_type_get()
|
||||
CheckDefAndScriptFailure2(['prop_type_get({"a": 10})'], 'E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['prop_type_get({"a": 10}, "b")'], 'E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['prop_type_get("a", "b")'], 'E1013: Argument 2: type mismatch, expected dict<any> but got string', 'E1206: Dictionary required for argument 2')
|
||||
assert_fails("prop_type_get('')", 'E474:')
|
||||
enddef
|
||||
|
||||
def Test_prop_type_list()
|
||||
@@ -2588,6 +2653,7 @@ def Test_readfile()
|
||||
|
||||
CheckDefAndScriptFailure2(['readfile("a", 0z10)'], 'E1013: Argument 2: type mismatch, expected string but got blob', 'E1174: String required for argument 2')
|
||||
CheckDefAndScriptFailure2(['readfile("a", "b", "c")'], 'E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3')
|
||||
CheckDefExecAndScriptFailure(['readfile("")'], 'E1175: Non-empty string required for argument 1')
|
||||
enddef
|
||||
|
||||
def Test_reduce()
|
||||
@@ -2724,6 +2790,7 @@ enddef
|
||||
def Test_rename()
|
||||
CheckDefAndScriptFailure2(['rename(1, "b")'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['rename("a", 2)'], 'E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2')
|
||||
rename('', '')->assert_equal(0)
|
||||
enddef
|
||||
|
||||
def Test_repeat()
|
||||
@@ -2743,6 +2810,7 @@ enddef
|
||||
def Test_resolve()
|
||||
CheckDefAndScriptFailure2(['resolve([])'], 'E1013: Argument 1: type mismatch, expected string but got list<unknown>', 'E1174: String required for argument 1')
|
||||
assert_equal('SomeFile', resolve('SomeFile'))
|
||||
resolve('')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_reverse()
|
||||
@@ -2868,6 +2936,11 @@ def Test_searchpair()
|
||||
normal 0f{
|
||||
assert_equal([0, 0], searchpairpos('{', '', '}', '', 'col(".") > col'))
|
||||
|
||||
# searchpair with empty strings
|
||||
normal 8|
|
||||
assert_equal(0, searchpair('', '', ''))
|
||||
assert_equal([0, 0], searchpairpos('', '', ''))
|
||||
|
||||
var lines =<< trim END
|
||||
vim9script
|
||||
setline(1, '()')
|
||||
@@ -2917,6 +2990,9 @@ enddef
|
||||
def Test_shellescape()
|
||||
CheckDefAndScriptFailure2(['shellescape(1)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['shellescape("a", 2)'], 'E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2')
|
||||
if has('unix')
|
||||
assert_equal("''", shellescape(''))
|
||||
endif
|
||||
enddef
|
||||
|
||||
def Test_set_get_bufline()
|
||||
@@ -3047,12 +3123,16 @@ enddef
|
||||
|
||||
def Test_setenv()
|
||||
CheckDefAndScriptFailure2(['setenv(1, 2)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
assert_equal(0, setenv('', ''))
|
||||
assert_equal(0, setenv('', v:null))
|
||||
enddef
|
||||
|
||||
def Test_setfperm()
|
||||
CheckDefAndScriptFailure2(['setfperm(1, "b")'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['setfperm("a", 0z10)'], 'E1013: Argument 2: type mismatch, expected string but got blob', 'E1174: String required for argument 2')
|
||||
CheckDefExecAndScriptFailure(['setfperm("Xfile", "")'], 'E475: Invalid argument')
|
||||
CheckDefExecAndScriptFailure(['setfperm("", "")'], 'E475: Invalid argument')
|
||||
assert_equal(0, setfperm('', 'rw-r--r--'))
|
||||
enddef
|
||||
|
||||
def Test_setline()
|
||||
@@ -3107,6 +3187,8 @@ def Test_setreg()
|
||||
assert_fails('setreg("ab", 0)', 'E1162:')
|
||||
CheckDefAndScriptFailure2(['setreg(1, "b")'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['setreg("a", "b", 3)'], 'E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3')
|
||||
setreg('', '1a2b3c')
|
||||
assert_equal('1a2b3c', @")
|
||||
enddef
|
||||
|
||||
def Test_settabvar()
|
||||
@@ -3126,6 +3208,7 @@ def Test_settagstack()
|
||||
CheckDefAndScriptFailure2(['settagstack(true, {})'], 'E1013: Argument 1: type mismatch, expected number but got bool', 'E1210: Number required for argument 1')
|
||||
CheckDefAndScriptFailure2(['settagstack(1, [1])'], 'E1013: Argument 2: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 2')
|
||||
CheckDefAndScriptFailure2(['settagstack(1, {}, 2)'], 'E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3')
|
||||
assert_fails('settagstack(1, {}, "")', 'E962: Invalid action')
|
||||
enddef
|
||||
|
||||
def Test_setwinvar()
|
||||
@@ -3138,6 +3221,7 @@ def Test_sha256()
|
||||
CheckDefAndScriptFailure2(['sha256(100)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['sha256(0zABCD)'], 'E1013: Argument 1: type mismatch, expected string but got blob', 'E1174: String required for argument 1')
|
||||
assert_equal('ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad', sha256('abc'))
|
||||
assert_equal('e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', sha256(''))
|
||||
enddef
|
||||
|
||||
def Test_shiftwidth()
|
||||
@@ -3153,6 +3237,7 @@ enddef
|
||||
def Test_sign_getdefined()
|
||||
CheckDefAndScriptFailure2(['sign_getdefined(["x"])'], 'E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['sign_getdefined(2)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
sign_getdefined('')->assert_equal([])
|
||||
enddef
|
||||
|
||||
def Test_sign_getplaced()
|
||||
@@ -3173,6 +3258,7 @@ def Test_sign_place()
|
||||
CheckDefAndScriptFailure2(['sign_place(1, "b", 3, "d")'], 'E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3')
|
||||
CheckDefAndScriptFailure2(['sign_place(1, "b", "c", 1.1)'], 'E1013: Argument 4: type mismatch, expected string but got float', 'E1220: String or Number required for argument 4')
|
||||
CheckDefAndScriptFailure2(['sign_place(1, "b", "c", "d", [1])'], 'E1013: Argument 5: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 5')
|
||||
assert_fails("sign_place(0, '', '', '')", 'E155:')
|
||||
enddef
|
||||
|
||||
def Test_sign_placelist()
|
||||
@@ -3199,6 +3285,7 @@ enddef
|
||||
def Test_simplify()
|
||||
CheckDefAndScriptFailure2(['simplify(100)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
call assert_equal('NonExistingFile', simplify('NonExistingFile'))
|
||||
simplify('')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_slice()
|
||||
@@ -3257,6 +3344,7 @@ enddef
|
||||
def Test_soundfold()
|
||||
CheckDefAndScriptFailure2(['soundfold(20)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
assert_equal('abc', soundfold('abc'))
|
||||
assert_equal('', soundfold(''))
|
||||
enddef
|
||||
|
||||
def Test_sort_return_type()
|
||||
@@ -3284,6 +3372,7 @@ enddef
|
||||
def Test_spellbadword()
|
||||
CheckDefAndScriptFailure2(['spellbadword(100)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
spellbadword('good')->assert_equal(['', ''])
|
||||
spellbadword('')->assert_equal(['', ''])
|
||||
enddef
|
||||
|
||||
def Test_split()
|
||||
@@ -3291,6 +3380,8 @@ def Test_split()
|
||||
CheckDefAndScriptFailure2(['split(1, "b")'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['split("a", 2)'], 'E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2')
|
||||
CheckDefAndScriptFailure2(['split("a", "b", 2)'], 'E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3')
|
||||
split('')->assert_equal([])
|
||||
split('', '')->assert_equal([])
|
||||
enddef
|
||||
|
||||
def Test_srand()
|
||||
@@ -3303,12 +3394,13 @@ def Test_state()
|
||||
assert_equal('', state('a'))
|
||||
enddef
|
||||
|
||||
def Run_str2float()
|
||||
def Test_str2float()
|
||||
if !has('float')
|
||||
CheckFeature float
|
||||
endif
|
||||
else
|
||||
str2float("1.00")->assert_equal(1.00)
|
||||
str2float("2e-2")->assert_equal(0.02)
|
||||
str2float('')->assert_equal(0.0)
|
||||
|
||||
CheckDefAndScriptFailure2(['str2float(123)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
endif
|
||||
@@ -3320,10 +3412,12 @@ def Test_str2list()
|
||||
assert_equal([97], str2list('a'))
|
||||
assert_equal([97], str2list('a', 1))
|
||||
assert_equal([97], str2list('a', true))
|
||||
str2list('')->assert_equal([])
|
||||
enddef
|
||||
|
||||
def Test_str2nr()
|
||||
str2nr("1'000'000", 10, true)->assert_equal(1000000)
|
||||
str2nr('')->assert_equal(0)
|
||||
|
||||
CheckDefAndScriptFailure2(['str2nr(123)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['str2nr("123", "x")'], 'E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2')
|
||||
@@ -3341,6 +3435,7 @@ def Test_strcharpart()
|
||||
CheckDefAndScriptFailure2(['strcharpart("a", "b")'], 'E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2')
|
||||
CheckDefAndScriptFailure2(['strcharpart("a", 1, "c")'], 'E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3')
|
||||
CheckDefAndScriptFailure2(['strcharpart("a", 1, 1, 2)'], 'E1013: Argument 4: type mismatch, expected bool but got number', 'E1212: Bool required for argument 4')
|
||||
strcharpart('', 0)->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_strchars()
|
||||
@@ -3350,27 +3445,37 @@ def Test_strchars()
|
||||
assert_equal(3, strchars('abc'))
|
||||
assert_equal(3, strchars('abc', 1))
|
||||
assert_equal(3, strchars('abc', true))
|
||||
strchars('')->assert_equal(0)
|
||||
enddef
|
||||
|
||||
def Test_strdisplaywidth()
|
||||
CheckDefAndScriptFailure2(['strdisplaywidth(1)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['strdisplaywidth("a", "x")'], 'E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2')
|
||||
strdisplaywidth('')->assert_equal(0)
|
||||
enddef
|
||||
|
||||
def Test_strftime()
|
||||
CheckDefAndScriptFailure2(['strftime(1)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['strftime("a", "x")'], 'E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2')
|
||||
if exists('*strftime')
|
||||
CheckDefAndScriptFailure2(['strftime(1)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['strftime("a", "x")'], 'E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2')
|
||||
strftime('')->assert_equal('')
|
||||
endif
|
||||
enddef
|
||||
|
||||
def Test_strgetchar()
|
||||
CheckDefAndScriptFailure2(['strgetchar(1, 1)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['strgetchar("a", "x")'], 'E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2')
|
||||
strgetchar('', 0)->assert_equal(-1)
|
||||
strgetchar('', 1)->assert_equal(-1)
|
||||
enddef
|
||||
|
||||
def Test_stridx()
|
||||
CheckDefAndScriptFailure2(['stridx([1], "b")'], 'E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['stridx("a", {})'], 'E1013: Argument 2: type mismatch, expected string but got dict<unknown>', 'E1174: String required for argument 2')
|
||||
CheckDefAndScriptFailure2(['stridx("a", "b", "c")'], 'E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3')
|
||||
stridx('', '')->assert_equal(0)
|
||||
stridx('', 'a')->assert_equal(-1)
|
||||
stridx('a', '')->assert_equal(0)
|
||||
enddef
|
||||
|
||||
def Test_strlen()
|
||||
@@ -3384,32 +3489,38 @@ def Test_strpart()
|
||||
CheckDefAndScriptFailure2(['strpart("a", "b")'], 'E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2')
|
||||
CheckDefAndScriptFailure2(['strpart("a", 1, "c")'], 'E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3')
|
||||
CheckDefAndScriptFailure2(['strpart("a", 1, 1, 2)'], 'E1013: Argument 4: type mismatch, expected bool but got number', 'E1212: Bool required for argument 4')
|
||||
strpart('', 0)->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_strptime()
|
||||
CheckFunction strptime
|
||||
CheckDefAndScriptFailure2(['strptime(10, "2021")'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['strptime("%Y", 2021)'], 'E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2')
|
||||
# BUG: Directly calling strptime() in this function gives an "E117: Unknown
|
||||
# function" error on MS-Windows even with the above CheckFunction call for
|
||||
# strptime().
|
||||
#assert_true(strptime('%Y', '2021') != 0)
|
||||
if exists_compiled('*strptime')
|
||||
CheckDefAndScriptFailure2(['strptime(10, "2021")'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['strptime("%Y", 2021)'], 'E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2')
|
||||
assert_true(strptime('%Y', '2021') != 0)
|
||||
assert_true(strptime('%Y', '') == 0)
|
||||
endif
|
||||
enddef
|
||||
|
||||
def Test_strridx()
|
||||
CheckDefAndScriptFailure2(['strridx([1], "b")'], 'E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['strridx("a", {})'], 'E1013: Argument 2: type mismatch, expected string but got dict<unknown>', 'E1174: String required for argument 2')
|
||||
CheckDefAndScriptFailure2(['strridx("a", "b", "c")'], 'E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3')
|
||||
strridx('', '')->assert_equal(0)
|
||||
strridx('', 'a')->assert_equal(-1)
|
||||
strridx('a', '')->assert_equal(1)
|
||||
enddef
|
||||
|
||||
def Test_strtrans()
|
||||
CheckDefAndScriptFailure2(['strtrans(20)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
assert_equal('abc', strtrans('abc'))
|
||||
strtrans('')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_strwidth()
|
||||
CheckDefAndScriptFailure2(['strwidth(10)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
assert_equal(4, strwidth('abcd'))
|
||||
strwidth('')->assert_equal(0)
|
||||
enddef
|
||||
|
||||
def Test_submatch()
|
||||
@@ -3433,6 +3544,7 @@ def Test_substitute()
|
||||
CheckDefAndScriptFailure2(['substitute(1, "b", "1", "d")'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['substitute("a", 2, "1", "d")'], 'E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2')
|
||||
CheckDefAndScriptFailure2(['substitute("a", "b", "1", 4)'], 'E1013: Argument 4: type mismatch, expected string but got number', 'E1174: String required for argument 4')
|
||||
substitute('', '', '', '')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_swapinfo()
|
||||
@@ -3461,6 +3573,7 @@ def Test_synIDattr()
|
||||
CheckDefAndScriptFailure2(['synIDattr("a", "b")'], 'E1013: Argument 1: type mismatch, expected number but got string', 'E1210: Number required for argument 1')
|
||||
CheckDefAndScriptFailure2(['synIDattr(1, 2)'], 'E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2')
|
||||
CheckDefAndScriptFailure2(['synIDattr(1, "b", 3)'], 'E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3')
|
||||
synIDattr(1, '', '')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_synIDtrans()
|
||||
@@ -3519,6 +3632,8 @@ enddef
|
||||
def Test_taglist()
|
||||
CheckDefAndScriptFailure2(['taglist([1])'], 'E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['taglist("a", [2])'], 'E1013: Argument 2: type mismatch, expected string but got list<number>', 'E1174: String required for argument 2')
|
||||
taglist('')->assert_equal(0)
|
||||
taglist('', '')->assert_equal(0)
|
||||
enddef
|
||||
|
||||
def Test_term_dumpload()
|
||||
@@ -3777,22 +3892,30 @@ enddef
|
||||
|
||||
def Test_tolower()
|
||||
CheckDefAndScriptFailure2(['tolower(1)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
tolower('')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_toupper()
|
||||
CheckDefAndScriptFailure2(['toupper(1)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
toupper('')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_tr()
|
||||
CheckDefAndScriptFailure2(['tr(1, "a", "b")'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['tr("a", 1, "b")'], 'E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2')
|
||||
CheckDefAndScriptFailure2(['tr("a", "a", 1)'], 'E1013: Argument 3: type mismatch, expected string but got number', 'E1174: String required for argument 3')
|
||||
tr('', '', '')->assert_equal('')
|
||||
tr('ab', '', '')->assert_equal('ab')
|
||||
assert_fails("tr('ab', 'ab', '')", 'E475:')
|
||||
assert_fails("tr('ab', '', 'AB')", 'E475:')
|
||||
enddef
|
||||
|
||||
def Test_trim()
|
||||
CheckDefAndScriptFailure2(['trim(["a"])'], 'E1013: Argument 1: type mismatch, expected string but got list<string>', 'E1174: String required for argument 1')
|
||||
CheckDefAndScriptFailure2(['trim("a", ["b"])'], 'E1013: Argument 2: type mismatch, expected string but got list<string>', 'E1174: String required for argument 2')
|
||||
CheckDefAndScriptFailure2(['trim("a", "b", "c")'], 'E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3')
|
||||
trim('')->assert_equal('')
|
||||
trim('', '')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_typename()
|
||||
@@ -3813,6 +3936,7 @@ enddef
|
||||
def Test_undofile()
|
||||
CheckDefAndScriptFailure2(['undofile(10)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
|
||||
assert_equal('.abc.un~', fnamemodify(undofile('abc'), ':t'))
|
||||
undofile('')->assert_equal('')
|
||||
enddef
|
||||
|
||||
def Test_uniq()
|
||||
|
||||
@@ -4278,6 +4278,10 @@ def Test_no_unknown_error_after_error()
|
||||
if !has('unix') || !has('job')
|
||||
throw 'Skipped: not unix of missing +job feature'
|
||||
endif
|
||||
# FIXME: this check should not be needed
|
||||
if has('win32')
|
||||
throw 'Skipped: does not work on MS-Windows'
|
||||
endif
|
||||
var lines =<< trim END
|
||||
vim9script
|
||||
var source: list<number>
|
||||
|
||||
@@ -5011,14 +5011,16 @@ ex_call(exarg_T *eap)
|
||||
--emsg_skip;
|
||||
clear_evalarg(&evalarg, eap);
|
||||
|
||||
// When inside :try we need to check for following "| catch".
|
||||
if (!aborting() && (!failed || eap->cstack->cs_trylevel > 0))
|
||||
// When inside :try we need to check for following "| catch" or "| endtry".
|
||||
// Not when there was an error, but do check if an exception was thrown.
|
||||
if ((!aborting() || did_throw)
|
||||
&& (!failed || eap->cstack->cs_trylevel > 0))
|
||||
{
|
||||
// Check for trailing illegal characters and a following command.
|
||||
arg = skipwhite(arg);
|
||||
if (!ends_excmd2(eap->arg, arg))
|
||||
{
|
||||
if (!failed)
|
||||
if (!failed && !aborting())
|
||||
{
|
||||
emsg_severe = TRUE;
|
||||
semsg(_(e_trailing_arg), arg);
|
||||
|
||||
@@ -51,6 +51,8 @@ init_longVersion(void)
|
||||
}
|
||||
|
||||
# else
|
||||
char *longVersion = NULL;
|
||||
|
||||
void
|
||||
init_longVersion(void)
|
||||
{
|
||||
@@ -72,7 +74,7 @@ init_longVersion(void)
|
||||
longVersion = VIM_VERSION_LONG;
|
||||
else
|
||||
vim_snprintf(longVersion, len, msg,
|
||||
VIM_VERSION_LONG_ONLY, VIM_VERSION_DATE_ONLY, date_time);
|
||||
VIM_VERSION_LONG_ONLY, VIM_VERSION_DATE_ONLY, date_time);
|
||||
}
|
||||
}
|
||||
# endif
|
||||
@@ -755,6 +757,34 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
3458,
|
||||
/**/
|
||||
3457,
|
||||
/**/
|
||||
3456,
|
||||
/**/
|
||||
3455,
|
||||
/**/
|
||||
3454,
|
||||
/**/
|
||||
3453,
|
||||
/**/
|
||||
3452,
|
||||
/**/
|
||||
3451,
|
||||
/**/
|
||||
3450,
|
||||
/**/
|
||||
3449,
|
||||
/**/
|
||||
3448,
|
||||
/**/
|
||||
3447,
|
||||
/**/
|
||||
3446,
|
||||
/**/
|
||||
3445,
|
||||
/**/
|
||||
3444,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user