summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-04-07 21:07:20 +0200
committerBram Moolenaar <Bram@vim.org>2021-04-07 21:07:20 +0200
commit130cbfc31235c6cb52ffe718ea0a5bb50fbbc9fd (patch)
treef2dc11400ba45de6450964841ac9ed3759594602
parent125ed2745c0a0570c1f81f249aebb023b2deef1b (diff)
Update runtime files
-rw-r--r--.github/CODEOWNERS7
-rw-r--r--runtime/compiler/powershell.vim84
-rw-r--r--runtime/doc/Makefile2
-rw-r--r--runtime/doc/cmdline.txt4
-rw-r--r--runtime/doc/editing.txt4
-rw-r--r--runtime/doc/eval.txt13
-rw-r--r--runtime/doc/ft_ps1.txt64
-rw-r--r--runtime/doc/gui_w32.txt4
-rw-r--r--runtime/doc/if_lua.txt2
-rw-r--r--runtime/doc/mbyte.txt4
-rw-r--r--runtime/doc/options.txt28
-rw-r--r--runtime/doc/os_win32.txt4
-rw-r--r--runtime/doc/syntax.txt2
-rw-r--r--runtime/doc/tags9
-rw-r--r--runtime/doc/testing.txt2
-rw-r--r--runtime/doc/todo.txt15
-rw-r--r--runtime/doc/usr_02.txt2
-rw-r--r--runtime/doc/version5.txt6
-rw-r--r--runtime/doc/version6.txt4
-rw-r--r--runtime/doc/vim9.txt36
-rw-r--r--runtime/ftplugin/fortran.vim15
-rw-r--r--runtime/ftplugin/ps1.vim59
-rw-r--r--runtime/ftplugin/ps1xml.vim34
-rw-r--r--runtime/indent/ps1.vim17
-rw-r--r--runtime/plugin/matchparen.vim7
-rw-r--r--runtime/syntax/fortran.vim19
-rw-r--r--runtime/syntax/nasm.vim5
-rw-r--r--runtime/syntax/ps1.vim182
-rw-r--r--runtime/syntax/ps1xml.vim51
-rw-r--r--src/po/fr.po2
30 files changed, 619 insertions, 68 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 4972e38bc5..79b62e93e9 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -42,6 +42,7 @@ runtime/compiler/jshint.vim @dkearns
runtime/compiler/jsonlint.vim @dkearns
runtime/compiler/lazbuild.vim @dkearns
runtime/compiler/php.vim @dkearns
+runtime/compiler/powershell.vim @heaths
runtime/compiler/rake.vim @tpope @dkearns
runtime/compiler/rhino.vim @dkearns
runtime/compiler/rspec.vim @tpope @dkearns
@@ -67,6 +68,7 @@ runtime/doc/pi_netrw.txt @cecamp
runtime/doc/pi_tar.txt @cecamp
runtime/doc/pi_vimball.txt @cecamp
runtime/doc/pi_zip.txt @cecamp
+runtime/doc/ps1.txt @heaths
runtime/ftplugin/awk.vim @dkearns
runtime/ftplugin/basic.vim @dkearns
runtime/ftplugin/bst.vim @tpope
@@ -93,6 +95,8 @@ runtime/ftplugin/matlab.vim @cecamp
runtime/ftplugin/nroff.vim @a-vrma
runtime/ftplugin/nsis.vim @k-takata
runtime/ftplugin/pdf.vim @tpope
+runtime/ftplugin/ps1.vim @heaths
+runtime/ftplugin/ps1xml.vim @heaths
runtime/ftplugin/ruby.vim @tpope @dkearns
runtime/ftplugin/sass.vim @tpope
runtime/ftplugin/scss.vim @tpope
@@ -111,6 +115,7 @@ runtime/indent/gitconfig.vim @tpope
runtime/indent/haml.vim @tpope
runtime/indent/liquid.vim @tpope
runtime/indent/nsis.vim @k-takata
+runtime/indent/ps1.vim @heaths
runtime/indent/ruby.vim @AndrewRadev @dkearns
runtime/indent/sass.vim @tpope
runtime/indent/scss.vim @tpope
@@ -173,6 +178,8 @@ runtime/syntax/pdf.vim @tpope
runtime/syntax/php.vim @TysonAndre
runtime/syntax/privoxy.vim @dkearns
runtime/syntax/prolog.vim @XVilka
+runtime/syntax/ps1.vim @heaths
+runtime/syntax/ps1xml.vim @heaths
runtime/syntax/rc.vim @chrisbra
runtime/syntax/rpcgen.vim @cecamp
runtime/syntax/ruby.vim @dkearns
diff --git a/runtime/compiler/powershell.vim b/runtime/compiler/powershell.vim
new file mode 100644
index 0000000000..45d5ec2191
--- /dev/null
+++ b/runtime/compiler/powershell.vim
@@ -0,0 +1,84 @@
+" Vim compiler file
+" Compiler: powershell
+" URL: https://github.com/PProvost/vim-ps1
+" Last Change: 2020 Mar 30
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "powershell"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+if !exists("g:ps1_makeprg_cmd")
+ if executable('pwsh')
+ " pwsh is the future
+ let g:ps1_makeprg_cmd = 'pwsh'
+ elseif executable('pwsh.exe')
+ let g:ps1_makeprg_cmd = 'pwsh.exe'
+ elseif executable('powershell.exe')
+ let g:ps1_makeprg_cmd = 'powershell.exe'
+ else
+ let g:ps1_makeprg_cmd = ''
+ endif
+endif
+
+if !executable(g:ps1_makeprg_cmd)
+ echoerr "To use the powershell compiler, please set g:ps1_makeprg_cmd to the powershell executable!"
+endif
+
+" Show CategoryInfo, FullyQualifiedErrorId, etc?
+let g:ps1_efm_show_error_categories = get(g:, 'ps1_efm_show_error_categories', 0)
+
+" Use absolute path because powershell requires explicit relative paths
+" (./file.ps1 is okay, but # expands to file.ps1)
+let &l:makeprg = g:ps1_makeprg_cmd .' %:p:S'
+
+" Parse file, line, char from callstacks:
+" Write-Ouput : The term 'Write-Ouput' is not recognized as the name of a
+" cmdlet, function, script file, or operable program. Check the spelling
+" of the name, or if a path was included, verify that the path is correct
+" and try again.
+" At C:\script.ps1:11 char:5
+" + Write-Ouput $content
+" + ~~~~~~~~~~~
+" + CategoryInfo : ObjectNotFound: (Write-Ouput:String) [], CommandNotFoundException
+" + FullyQualifiedErrorId : CommandNotFoundException
+
+" Showing error in context with underlining.
+CompilerSet errorformat=%+G+%m
+" Error summary.
+CompilerSet errorformat+=%E%*\\S\ :\ %m
+" Error location.
+CompilerSet errorformat+=%CAt\ %f:%l\ char:%c
+" Errors that span multiple lines (may be wrapped to width of terminal).
+CompilerSet errorformat+=%C%m
+" Ignore blank/whitespace-only lines.
+CompilerSet errorformat+=%Z\\s%#
+
+if g:ps1_efm_show_error_categories
+ CompilerSet errorformat^=%+G\ \ \ \ +\ %.%#\\s%#:\ %m
+else
+ CompilerSet errorformat^=%-G\ \ \ \ +\ %.%#\\s%#:\ %m
+endif
+
+
+" Parse file, line, char from of parse errors:
+" At C:\script.ps1:22 char:16
+" + Stop-Process -Name "invalidprocess
+" + ~~~~~~~~~~~~~~~
+" The string is missing the terminator: ".
+" + CategoryInfo : ParserError: (:) [], ParseException
+" + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString
+CompilerSet errorformat+=At\ %f:%l\ char:%c
+
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim:set sw=2 sts=2:
diff --git a/runtime/doc/Makefile b/runtime/doc/Makefile
index fcbcdc5bd6..e5ff1646ce 100644
--- a/runtime/doc/Makefile
+++ b/runtime/doc/Makefile
@@ -30,6 +30,7 @@ DOCS = \
filetype.txt \
fold.txt \
ft_ada.txt \
+ ft_ps1.txt \
ft_rust.txt \
ft_sql.txt \
gui.txt \
@@ -173,6 +174,7 @@ HTMLS = \
filetype.html \
fold.html \
ft_ada.html \
+ ft_ps1.html \
ft_rust.html \
ft_sql.html \
gui.html \
diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
index 92560216ee..68cb04000e 100644
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -1,4 +1,4 @@
-*cmdline.txt* For Vim version 8.2. Last change: 2021 Jan 26
+*cmdline.txt* For Vim version 8.2. Last change: 2021 Apr 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -597,9 +597,11 @@ followed by another Vim command:
:global
:help
:helpfind
+ :helpgrep
:lcscope
:ldo
:lfdo
+ :lhelpgrep
:make
:normal
:perl
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 4c4de79ee3..1351d4e96e 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1,4 +1,4 @@
-*editing.txt* For Vim version 8.2. Last change: 2021 Jan 08
+*editing.txt* For Vim version 8.2. Last change: 2021 Apr 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1253,7 +1253,7 @@ For versions of Vim where browsing is not supported, the command is executed
unmodified.
*browsefilter*
-For MS Windows and GTK, you can modify the filters that are used in the browse
+For MS-Windows and GTK, you can modify the filters that are used in the browse
dialog. By setting the g:browsefilter or b:browsefilter variables, you can
change the filters globally or locally to the buffer. The variable is set to
a string in the format "{filter label}\t{pattern};{pattern}\n" where {filter
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 97c968c748..798f58da54 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt* For Vim version 8.2. Last change: 2021 Mar 28
+*eval.txt* For Vim version 8.2. Last change: 2021 Apr 07
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1550,8 +1550,11 @@ the following ways:
The arguments are optional. Example: >
:let F = {-> 'error function'}
- :echo F()
+ :echo F('ignored')
< error function
+
+Note that in Vim9 script another kind of lambda can be used: |vim9-lambda|.
+
*closure*
Lambda expressions can access outer scope variables and arguments. This is
often called a closure. Example where "i" and "a:arg" are used in a lambda
@@ -1586,7 +1589,7 @@ The lambda expression is also useful for Channel, Job and timer: >
Handler called
Note how execute() is used to execute an Ex command. That's ugly though.
-
+In Vim9 script you can use a command block, see |inline-function|.
Lambda expressions have internal names like '<lambda>42'. If you get an error
for a lambda expression, you can find what it is with the following command: >
@@ -6087,7 +6090,7 @@ getwininfo([{winid}]) *getwininfo()*
tab pages is returned.
Each List item is a |Dictionary| with the following entries:
- botline last displayed buffer line
+ botline last complete displayed buffer line
bufnr number of buffer in the window
height window height (excluding winbar)
loclist 1 if showing a location list
@@ -11866,7 +11869,7 @@ gui_mac Compiled with Macintosh GUI.
gui_motif Compiled with Motif GUI.
gui_photon Compiled with Photon GUI.
gui_running Vim is running in the GUI, or it will start soon.
-gui_win32 Compiled with MS Windows Win32 GUI.
+gui_win32 Compiled with MS-Windows Win32 GUI.
gui_win32s idem, and Win32s system being used (Windows 3.1)
haiku Haiku version of Vim.
hangul_input Compiled with Hangul input support. |hangul|
diff --git a/runtime/doc/ft_ps1.txt b/runtime/doc/ft_ps1.txt
new file mode 100644
index 0000000000..df1480b929
--- /dev/null
+++ b/runtime/doc/ft_ps1.txt
@@ -0,0 +1,64 @@
+*ps1.txt* A Windows PowerShell syntax plugin for Vim
+
+Author: Peter Provost <https://www.github.com/PProvost>
+License: Apache 2.0
+URL: https://github.com/PProvost/vim-ps1
+
+INTRODUCTION *ps1-syntax*
+
+This plugin provides Vim syntax, indent and filetype detection for Windows
+PowerShell scripts, modules, and XML configuration files.
+
+
+ABOUT *ps1-about*
+
+Grab the latest version or report a bug on GitHub:
+
+https://github.com/PProvost/vim-ps1
+
+
+FOLDING *ps1-folding*
+
+The ps1 syntax file provides syntax folding (see |:syn-fold|) for script blocks
+and digital signatures in scripts.
+
+When 'foldmethod' is set to "syntax" then function script blocks will be
+folded unless you use the following in your .vimrc or before opening a script: >
+
+ :let g:ps1_nofold_blocks = 1
+<
+Digital signatures in scripts will also be folded unless you use: >
+
+ :let g:ps1_nofold_sig = 1
+<
+Note: syntax folding might slow down syntax highlighting significantly,
+especially for large files.
+
+
+COMPILER *ps1-compiler*
+
+The powershell `:compiler` script configures |:make| to execute the script in
+PowerShell.
+
+It tries to pick a smart default PowerShell command: `pwsh` if available and
+`powershell` otherwise, but you can customize the command: >
+
+ :let g:ps1_makeprg_cmd = '/path/to/pwsh'
+<
+To configure whether to show the exception type information: >
+
+ :let g:ps1_efm_show_error_categories = 1
+<
+
+KEYWORD LOOKUP *ps1-keyword*
+
+To look up keywords using PowerShell's Get-Help, press the |K| key. For more
+convenient paging, the pager `less` should be installed, which is included in
+many Linux distributions and in macOS.
+
+Many other distributions are available for Windows like
+https://chocolatey.org/packages/less/. Make sure `less` is in a directory
+listed in the `PATH` environment variable, which chocolatey above does.
+
+------------------------------------------------------------------------------
+ vim:ft=help:
diff --git a/runtime/doc/gui_w32.txt b/runtime/doc/gui_w32.txt
index c0f8867739..b83df1b98b 100644
--- a/runtime/doc/gui_w32.txt
+++ b/runtime/doc/gui_w32.txt
@@ -1,4 +1,4 @@
-*gui_w32.txt* For Vim version 8.2. Last change: 2020 Mar 25
+*gui_w32.txt* For Vim version 8.2. Last change: 2021 Apr 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -403,7 +403,7 @@ The "File/Print" menu prints the text with syntax highlighting, see
printer installed this should also work: >
:w >>prn
-Vim supports a number of standard MS Windows features. Some of these are
+Vim supports a number of standard MS-Windows features. Some of these are
detailed elsewhere: see |'mouse'|, |win32-hidden-menus|.
*drag-n-drop-win32*
diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt
index b7ccb04c53..48b42e65db 100644
--- a/runtime/doc/if_lua.txt
+++ b/runtime/doc/if_lua.txt
@@ -1,4 +1,4 @@
-*if_lua.txt* For Vim version 8.2. Last change: 2020 Jun 28
+*if_lua.txt* For Vim version 8.2. Last change: 2021 Apr 07
VIM REFERENCE MANUAL by Luis Carvalho
diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt
index 41e42a2aec..7a5cca3ac9 100644
--- a/runtime/doc/mbyte.txt
+++ b/runtime/doc/mbyte.txt
@@ -1,4 +1,4 @@
-*mbyte.txt* For Vim version 8.2. Last change: 2020 Aug 15
+*mbyte.txt* For Vim version 8.2. Last change: 2021 Apr 05
VIM REFERENCE MANUAL by Bram Moolenaar et al.
@@ -770,7 +770,7 @@ is suitable for complex input, such as CJK.
of the two ways: FrontEnd system and BackEnd system. In the FrontEnd
system, input events are snatched by the |IM-server| first, then |IM-server|
give the application the result of input. On the other hand, the BackEnd
- system works reverse order. MS Windows adopt BackEnd system. In X, most of
+ system works reverse order. MS-Windows adopt BackEnd system. In X, most of
|IM-server|s adopt FrontEnd system. The demerit of BackEnd system is the
large overhead in communication, but it provides safe synchronization with
no restrictions on applications.
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 0f628c0397..eb607d9cd9 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 8.2. Last change: 2021 Mar 29
+*options.txt* For Vim version 8.2. Last change: 2021 Apr 07
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4148,7 +4148,7 @@ A jump table for the options with a short description can be found at |Q_op|.
the window. This happens only when the 'icon' option is on.
Only works if the terminal supports setting window icon text
(currently only X11 GUI and terminals with a non-empty 't_IS' option).
- Does not work for MS Windows.
+ Does not work for MS-Windows.
When Vim was compiled with HAVE_X11 defined, the original icon will be
restored if possible |X11|.
When this option contains printf-style '%' items, they will be
@@ -5036,7 +5036,7 @@ A jump table for the options with a short description can be found at |Q_op|.
jump between two double quotes.
The characters must be separated by a colon.
The pairs must be separated by a comma. Example for including '<' and
- '>' (HTML): >
+ '>' (for HTML): >
:set mps+=<:>
< A more exotic example, to jump between the '=' and ';' in an
@@ -8790,23 +8790,31 @@ A jump table for the options with a short description can be found at |Q_op|.
part specifies what to do for each consecutive use of 'wildchar'. The
first part specifies the behavior for the first use of 'wildchar',
The second part for the second use, etc.
- These are the possible values for each part:
+
+ Each part consists of a colon separated list consisting of the
+ following possible values:
"" Complete only the first match.
"full" Complete the next full match. After the last match,
the original string is used and then the first match
- again.
+ again. Will also start 'wildmenu' if it is enabled.
"longest" Complete till longest common string. If this doesn't
result in a longer string, use the next part.
- "longest:full" Like "longest", but also start 'wildmenu' if it is
- enabled.
"list" When more than one match, list all matches.
+ "lastused" When completing buffer names and more than one buffer
+ matches, sort buffers by time last used (other than
+ the current buffer).
+ When there is only a single match, it is fully completed in all cases.
+
+ Examples of useful colon-separated values:
+ "longest:full" Like "longest", but also start 'wildmenu' if it is
+ enabled. Will not complete to the next full match.
"list:full" When more than one match, list all matches and
complete first match.
"list:longest" When more than one match, list all matches and
complete till longest common string.
- "list:lastused" When more than one buffer matches, sort buffers
- by time last used (other than the current buffer).
- When there is only a single match, it is fully completed in all cases.
+ "list:lastused" When more than one buffer matches, list all matches
+ and sort buffers by time last used (other than the
+ current buffer).
Examples: >
:set wildmode=full
diff --git a/runtime/doc/os_win32.txt b/runtime/doc/os_win32.txt
index 1017d4d261..6c366083f6 100644
--- a/runtime/doc/os_win32.txt
+++ b/runtime/doc/os_win32.txt
@@ -1,4 +1,4 @@
-*os_win32.txt* For Vim version 8.2. Last change: 2017 Mar 21
+*os_win32.txt* For Vim version 8.2. Last change: 2021 Apr 05
VIM REFERENCE MANUAL by George Reilly
@@ -83,7 +83,7 @@ executable() returns 1 the executable can actually be executed.
Command line arguments *win32-cmdargs*
-Analysis of a command line into parameters is not standardised in MS Windows.
+Analysis of a command line into parameters is not standardised in MS-Windows.
Vim and gvim used to use different logic to parse it (before 7.4.432), and the
logic was also depended on what it was compiled with. Now Vim and gvim both
use the CommandLineToArgvW() Win32 API, so they behave in the same way.
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index a165e83d64..685485d035 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1,4 +1,4 @@
-*syntax.txt* For Vim version 8.2. Last change: 2021 Mar 06
+*syntax.txt* For Vim version 8.2. Last change: 2021 Apr 02
VIM REFERENCE MANUAL by Bram Moolenaar
diff --git a/runtime/doc/tags b/runtime/doc/tags
index c070a126a3..b28f644e66 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -5434,6 +5434,7 @@ assert_fails() testing.txt /*assert_fails()*
assert_false() testing.txt /*assert_false()*
assert_inrange() testing.txt /*assert_inrange()*
assert_match() testing.txt /*assert_match()*
+assert_nobeep() testing.txt /*assert_nobeep()*
assert_notequal() testing.txt /*assert_notequal()*
assert_notmatch() testing.txt /*assert_notmatch()*
assert_report() testing.txt /*assert_report()*
@@ -7507,6 +7508,7 @@ info-message starting.txt /*info-message*
inform.vim syntax.txt /*inform.vim*
informix ft_sql.txt /*informix*
initialization starting.txt /*initialization*
+inline-function vim9.txt /*inline-function*
input() eval.txt /*input()*
inputdialog() eval.txt /*inputdialog()*
inputlist() eval.txt /*inputlist()*
@@ -8582,6 +8584,12 @@ prop_type_change() textprop.txt /*prop_type_change()*
prop_type_delete() textprop.txt /*prop_type_delete()*
prop_type_get() textprop.txt /*prop_type_get()*
prop_type_list() textprop.txt /*prop_type_list()*
+ps1-about ft_ps1.txt /*ps1-about*
+ps1-compiler ft_ps1.txt /*ps1-compiler*
+ps1-folding ft_ps1.txt /*ps1-folding*
+ps1-keyword ft_ps1.txt /*ps1-keyword*
+ps1-syntax ft_ps1.txt /*ps1-syntax*
+ps1.txt ft_ps1.txt /*ps1.txt*
psql ft_sql.txt /*psql*
ptcap.vim syntax.txt /*ptcap.vim*
pterm-mouse options.txt /*pterm-mouse*
@@ -10137,6 +10145,7 @@ vim9-export vim9.txt /*vim9-export*
vim9-final vim9.txt /*vim9-final*
vim9-gotchas vim9.txt /*vim9-gotchas*
vim9-import vim9.txt /*vim9-import*
+vim9-lambda vim9.txt /*vim9-lambda*
vim9-mix vim9.txt /*vim9-mix*
vim9-namespace vim9.txt /*vim9-namespace*
vim9-rationale vim9.txt /*vim9-rationale*
diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt
index 5d85358d71..6fd2d45887 100644
--- a/runtime/doc/testing.txt
+++ b/runtime/doc/testing.txt
@@ -1,4 +1,4 @@
-*testing.txt* For Vim version 8.2. Last change: 2021 Mar 10
+*testing.txt* For Vim version 8.2. Last change: 2021 Apr 02
VIM REFERENCE MANUAL by Bram Moolenaar
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 8e70f36e86..1a3f4cc57d 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 8.2. Last change: 2021 Mar 29
+*todo.txt* For Vim version 8.2. Last change: 2021 Apr 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -42,17 +42,12 @@ Vim9 - Make everything work:
- For builtin functions using tv_get_string*() use check_for_string() to be
more strict about the argument type (not a bool).
done: balloon_()
-- Run the same tests in :def and Vim9 script, like in Test_expr7_not()
- Check many more builtin function arguments at compile time.
-- make 0 == 'string' fail on the script level, like inside :def.
-- Check that when using a user function name without prefix, it does not find
- a global function. Prefixing g: is required.
-- Appending to dict item doesn't work in a :def function:
- var d: dict<string> = {a: 'x'}
- d['a'] ..= 'y'
- d.a ..= 'y'
- Test to be extended: Test_assign_dict_with_op()
- Using ".." at script level doesn't convert arguments to a string.
+- This fails in a :def function but not at the script level:
+ var s = 'asdf'->((a) => a)('x')
+ Disallow passing more arguments to lambda than expected?
+- Implement blob index and slice, also with assignment?
- Compile replacement of :s command: s/pat/\=expr/
- Compile redir to local variable: var_redir_start().
- Implement type cast at the script level.
diff --git a/runtime/doc/usr_02.txt b/runtime/doc/usr_02.txt
index a866b7abbf..53d6cb5485 100644
--- a/runtime/doc/usr_02.txt
+++ b/runtime/doc/usr_02.txt
@@ -43,7 +43,7 @@ like:
|~ |
|"file.txt" [New file] |
+---------------------------------------+
- ('#" is the cursor position.)
+ ('#' is the cursor position.)
The tilde (~) lines indicate lines not in the file. In other words, when Vim
runs out of file to display, it displays tilde lines. At the bottom of the
diff --git a/runtime/doc/version5.txt b/runtime/doc/version5.txt
index 2b44cbda77..d74f5a7377 100644
--- a/runtime/doc/version5.txt
+++ b/runtime/doc/version5.txt
@@ -1,4 +1,4 @@
-*version5.txt* For Vim version 8.2. Last change: 2020 Dec 19
+*version5.txt* For Vim version 8.2. Last change: 2021 Apr 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -405,7 +405,7 @@ Both of these are only available when enabled at compile time.
Win32 GUI version *added-win32-GUI*
-----------------
-The GUI has been ported to MS Windows 95 and NT. All the features of the X11
+The GUI has been ported to MS-Windows 95 and NT. All the features of the X11
GUI are available to Windows users now. |gui-w32|
This also fixes problems with running the Win32 console version under Windows
95, where console support has always been bad.
@@ -4403,7 +4403,7 @@ the last char of the line, "<<" moved an extra line. Also for other operators
that always work on lines.
link.sh changed "-lnsl_s" to "_s" when looking for "nsl" to be removed.
-Now it only remove whole words.
+Now it only removes whole words.
When jumped to a mark or using "fz", and there is an error, the current column
was lost. E.g. when using "$fzj".
diff --git a/runtime/doc/version6.txt b/runtime/doc/version6.txt
index ca1800fe35..de364d64a3 100644
--- a/runtime/doc/version6.txt
+++ b/runtime/doc/version6.txt
@@ -1,4 +1,4 @@
-*version6.txt* For Vim version 8.2. Last change: 2021 Jan 17
+*version6.txt* For Vim version 8.2. Last change: 2021 Apr 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1025,7 +1025,7 @@ Port to OS/390 Unix (Ralf Schandl)
Included jsbmouse support. (Darren Garth)
Support for dec mouse in Unix. (Steve Wall)
-Port to 16-bit MS Windows (Windows 3.1x) (Vince Negri)
+Port to 16-bit MS-Windows (Windows 3.1x) (Vince Negri)
Port to QNX. Supports the Photon GUI, mouse, etc. (Julian Kinraid)
diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt
index 974ee6af6b..e693cba1df 100644
--- a/runtime/doc/vim9.txt
+++ b/runtime/doc/vim9.txt
@@ -1,4 +1,4 @@
-*vim9.txt* For Vim version 8.2. Last change: 2021 Mar 30
+*vim9.txt* For Vim version 8.2. Last change: 2021 Apr 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -305,13 +305,21 @@ Variables, functions and function arguments cannot shadow previously defined
or imported variables and functions in the same script file.
Variables may shadow Ex commands, rename the variable if needed.
-Global variables and user defined functions must be prefixed with "g:", also
-at the script level. >
+Global variables must be prefixed with "g:", also at the script level. >
vim9script
var script_local = 'text'
g:global = 'value'
var Funcref = g:ThatFunction
+Global functions must be prefixed with "g:" when defining them, but can be
+called without "g:". >
+ vim9script
+ def g:GlobalFunc(): string
+ return 'text'
+ enddef
+ echo GlobalFunc()
+The "g:" prefix is not needed for auto-load functions.
+
Since `&opt = value` is now assigning a value to option "opt", ":&" cannot be
used to repeat a `:substitute` command.
@@ -401,7 +409,7 @@ number of arguments and any return type. The function can be defined later.
Lambda using => instead of -> ~
-
+ *vim9-lambda*
In legacy script there can be confusion between using "->" for a method call
and for a lambda. Also, when a "{" is found the parser needs to figure out if
it is the start of a lambda or a dictionary, which is now more complicated
@@ -425,12 +433,19 @@ But you can use a backslash to concatenate the lines before parsing: >
filter(list, (k,
\ v)
\ => v > 0)
-
+< *inline-function*
Additionally, a lambda can contain statements in {}: >
var Lambda = (arg) => {
g:was_called = 'yes'
return expression
}
+This can be useful for a timer, for example: >
+ var count = 0
+ var timer = timer_start(500, (_) => {
+ count += 1
+ echom 'Handler called ' .. count
+ }, {repeat: 3})
+
The ending "}" must be at the start of a line. It can be followed by other
characters, e.g.: >
@@ -836,7 +851,7 @@ Patterns are used like 'magic' is set, unless explicitly overruled.
The 'edcompatible' option value is not used.
The 'gdefault' option value is not used.
-You may also find this wiki useful. It was written by an early adoptor of
+You may also find this wiki useful. It was written by an early adopter of
Vim9 script: https://github.com/lacygoill/wiki/blob/master/vim/vim9.md
==============================================================================
@@ -881,14 +896,14 @@ THIS IS STILL UNDER DEVELOPMENT - ANYTHING CAN BREAK - ANYTHING CAN CHANGE
:enddef End of a function defined with `:def`. It should be on
a line by its own.
-You may also find this wiki useful. It was written by an early adoptor of
+You may also find this wiki useful. It was written by an early adopter of
Vim9 script: https://github.com/lacygoill/wiki/blob/master/vim/vim9.md
If the script the function is defined in is Vim9 script, then script-local
variables can be accessed without the "s:" prefix. They must be defined
before the function is compiled. If the script the function is defined in is
legacy script, then script-local variables must be accessed with the "s:"
-prefix and they do not need to exist (they can be deleted any time).
+prefix if they do not exist at the time of compiling.
*:defc* *:defcompile*
:defc[ompile] Compile functions defined in the current script that
@@ -1073,12 +1088,15 @@ dictionary. If there is a mix of types, the "any" type is used. >
['a', 'b', 'c'] list<string>
[1, 'x', 3] list<any>
+For script-local variables in Vim9 script the type is checked, also when the
+variable was declared in a legacy function.
+
Stricter type checking ~
*type-checking*
In legacy Vim script, where a number was expected, a string would be
automatically converted to a number. This was convenient for an actual number
-such as "123", but leads to unexpected problems (but no error message) if the
+such as "123", but leads to unexpected problems (and no error message) if the
string doesn't start with a number. Quite often this leads to hard-to-find
bugs.
diff --git a/runtime/ftplugin/fortran.vim b/runtime/ftplugin/fortran.vim
index b9ba3c4722..26dc90a184 100644
--- a/runtime/ftplugin/fortran.vim
+++ b/runtime/ftplugin/fortran.vim
@@ -1,13 +1,13 @@
" Vim settings file
" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, 77, 66)
-" Version: (v52) 2020 October 07
+" Version: (v53) 2021 April 06
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
" Usage: For instructions, do :help fortran-plugin from Vim
" Credits:
" Version 0.1 was created in September 2000 by Ajit Thakkar.
" Since then, useful suggestions and contributions have been made, in order, by:
" Stefano Zacchiroli, Hendrik Merx, Ben Fritz, David Barnett, Eisuke Kawashima,
-" and Doug Kearns.
+" Doug Kearns, and Fritz Reese.
" Only do these settings when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -66,12 +66,19 @@ endif
" Set comments and textwidth according to source type
if (b:fortran_fixed_source == 1)
setlocal comments=:!,:*,:C
- " Fixed format requires a textwidth of 72 for code
- setlocal tw=72
+ " Fixed format requires a textwidth of 72 for code,
+ " but some vendor extensions allow longer lines
+ if exists("fortran_extended_line_length")
+ setlocal tw=132
+ elseif exists("fortran_cardimage_line_length")
+ setlocal tw=80
+ else
+ setlocal tw=72
" If you n