Skip to content

Commit c79c208

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents a530cca + 6e4cfff commit c79c208

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+3920
-2430
lines changed

Filelist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ SRC_ALL = \
149149
src/vim9compile.c \
150150
src/vim9execute.c \
151151
src/vim9script.c \
152+
src/vim9type.c \
152153
src/viminfo.c \
153154
src/winclip.c \
154155
src/window.c \
@@ -172,6 +173,7 @@ SRC_ALL = \
172173
src/testdir/setup_gui.vim \
173174
src/testdir/shared.vim \
174175
src/testdir/vim9.vim \
176+
src/testdir/script_util.vim \
175177
src/testdir/summarize.vim \
176178
src/testdir/term_util.vim \
177179
src/testdir/view_util.vim \
@@ -303,6 +305,7 @@ SRC_ALL = \
303305
src/proto/vim9compile.pro \
304306
src/proto/vim9execute.pro \
305307
src/proto/vim9script.pro \
308+
src/proto/vim9type.pro \
306309
src/proto/viminfo.pro \
307310
src/proto/winclip.pro \
308311
src/proto/window.pro \

README_VIM9.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
This is an experimental side of [Vim](https://github.com/vim/vim).
66
It explores ways of making Vim script faster and better.
77

8-
WARNING: The Vim9 script features are in the early stages of development,
9-
anything can break!
8+
WARNING: The Vim9 script features are still under development, anything can
9+
break!
1010

1111
# Why Vim9?
1212

@@ -52,7 +52,7 @@ we can gain, and also that Vim script can be faster than builtin
5252
interfaces.
5353

5454
In practice the script would not do something useless as counting but change
55-
the text. For example, re-indent all the lines:
55+
the text. For example, reindent all the lines:
5656

5757
``` vim
5858
let totallen = 0
@@ -91,9 +91,9 @@ Instead of using script language support in Vim:
9191
with them. The job and channel support already makes this possible.
9292
Really any language can be used, also Java and Go, which are not
9393
available built-in.
94-
* Phase out the built-in language interfaces, make maintenance a bit easier
95-
and executables easier to build. They will be kept for backwards
96-
compatibility, no new features.
94+
* No priority for the built-in language interfaces. They will have to be kept
95+
for backwards compatibility, but many users won't need a Vim build with these
96+
interfaces.
9797
* Improve the Vim script language, it is used to communicate with the external
9898
tool and implements the Vim side of the interface. Also, it can be used when
9999
an external tool is undesired.
@@ -140,6 +140,9 @@ Taking this one step further is also dropping "s:" for script-local variables;
140140
everything at the script level is script-local by default. Since this is not
141141
backwards compatible it requires a new script style: Vim9 script!
142142

143+
To avoid having more variations, the syntax inside a compiled function is the
144+
same as in Vim9 script. Thus you have legacy syntax and Vim9 syntax.
145+
143146
It should be possible to convert code from other languages to Vim
144147
script. We can add functionality to make this easier. This still needs
145148
to be discussed, but we can consider adding type checking and a simple

runtime/autoload/javascriptcomplete.vim

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
" Vim completion script
22
" Language: Java Script
3-
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
4-
" Last Change: 2017 Mar 04
3+
" Maintainer: Jay Sitter (jay@jaysitter.com)
4+
" URL: https://github.com/jsit/javascriptcomplete.vim/
5+
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
6+
" Last Change: 2020 Jul 30
57

68
function! javascriptcomplete#CompleteJS(findstart, base)
79
if a:findstart
@@ -154,12 +156,30 @@ function! javascriptcomplete#CompleteJS(findstart, base)
154156
\ 'text', 'vLink']
155157
let bodys = bodyprop
156158
" Document - document.
157-
let docuprop = ['anchors', 'applets', 'childNodes', 'embeds', 'forms', 'images', 'links', 'stylesheets',
158-
\ 'body', 'cookie', 'documentElement', 'domain', 'lastModified', 'referrer', 'title', 'URL']
159-
let documeth = ['close', 'createAttribute', 'createElement', 'createTextNode', 'focus', 'getElementById',
160-
\ 'getElementsByName', 'getElementsByTagName', 'open', 'write', 'writeln',
161-
\ 'onClick', 'onDblClick', 'onFocus', 'onKeyDown', 'onKeyPress', 'onKeyUp',
162-
\ 'onMouseDown', 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp', 'onResize']
159+
let docuprop = ['anchors', 'body', 'characterSet', 'doctype',
160+
\ 'documentElement', 'documentURI', 'embeds', 'fonts', 'forms',
161+
\ 'head', 'hidden', 'images', 'implementation', 'lastStyleSheetSet',
162+
\ 'links', 'plugins', 'preferredStyleSheetSet', 'scripts',
163+
\ 'scrollingElement', 'selectedStyleSheetSet', 'styleSheetSets',
164+
\ 'timeline', 'visibilityState', 'cookie', 'defaultView',
165+
\ 'designMode', 'dir', 'domain', 'lastModified', 'location',
166+
\ 'readyState', 'referrer', 'title', 'URL', 'activeElement',
167+
\ 'fullscreenElement', 'styleSheets']
168+
let documeth = ['adoptNode', 'close', 'createAttribute',
169+
\ 'createAttributeNS', 'createCDATASection', 'createComment',
170+
\ 'createDocumentFragment', 'createElement', 'createElementNS',
171+
\ 'createEvent', 'createExpression', 'createNSResolver',
172+
\ 'createNodeIterator', 'createProcessingInstruction', 'createRange',
173+
\ 'createTextNode', 'createTouchList', 'createTreeWalker',
174+
\ 'enableStyleSheetsForSet', 'evaluate', 'focus', 'getElementById',
175+
\ 'getElementById', 'getElementsByClassName', 'getElementsByName',
176+
\ 'getElementsByTagName', 'getElementsByTagNameNS',
177+
\ 'hasStorageAccess', 'importNode', 'onClick', 'onDblClick',
178+
\ 'onFocus', 'onKeyDown', 'onKeyPress', 'onKeyUp', 'onMouseDown',
179+
\ 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp',
180+
\ 'onResize', 'open', 'querySelector', 'querySelectorAll',
181+
\ 'requestStorageAccess', 'write', 'writeln']
182+
163183
call map(documeth, 'v:val."("')
164184
let docuxprop = ['attributes', 'childNodes', 'doctype', 'documentElement', 'firstChild',
165185
\ 'implementation', 'namespaceURI', 'nextSibling', 'nodeName', 'nodeType',
@@ -368,9 +388,11 @@ function! javascriptcomplete#CompleteJS(findstart, base)
368388
let xdomelemprop = ['attributes', 'childNodes', 'firstChild', 'lastChild',
369389
\ 'namespaceURI', 'nextSibling', 'nodeName', 'nodeType', 'nodeValue',
370390
\ 'ownerDocument', 'parentNode', 'prefix', 'previousSibling', 'tagName']
371-
let xdomelemmeth = ['appendChild', 'cloneNode', 'getAttribute', 'getAttributeNode',
372-
\ 'getElementsByTagName', 'hasChildNodes', 'insertBefore', 'normalize',
373-
\ 'removeAttribute', 'removeAttributeNode', 'removeChild', 'replaceChild',
391+
let xdomelemmeth = ['appendChild', 'addEventListener', 'cloneNode',
392+
\ 'dispatchEvent', 'getAttribute', 'getAttributeNode',
393+
\ 'getElementsByTagName', 'hasChildNodes', 'insertBefore',
394+
\ 'normalize', 'removeAttribute', 'removeAttributeNode',
395+
\ 'removeChild', 'removeEventListener', 'replaceChild',
374396
\ 'setAttribute', 'setAttributeNode']
375397
call map(xdomelemmeth, 'v:val."("')
376398
let xdomelems = xdomelemprop + xdomelemmeth

runtime/compiler/xo.vim

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
" Vim compiler file
2+
" Compiler: XO
3+
" Maintainer: Doug Kearns <dougkearns@gmail.com>
4+
" Last Change: 2019 Jul 10
5+
6+
if exists("current_compiler")
7+
finish
8+
endif
9+
let current_compiler = "xo"
10+
11+
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
12+
command -nargs=* CompilerSet setlocal <args>
13+
endif
14+
15+
let s:cpo_save = &cpo
16+
set cpo&vim
17+
18+
" CompilerSet makeprg=npx\ xo\ --reporter\ compact
19+
20+
CompilerSet makeprg=xo\ --reporter\ compact
21+
CompilerSet errorformat=%f:\ line\ %l\\,\ col\ %c\\,\ %trror\ %m,
22+
\%f:\ line\ %l\\,\ col\ %c\\,\ %tarning\ %m,
23+
\%-G%.%#
24+
25+
let &cpo = s:cpo_save
26+
unlet s:cpo_save

runtime/doc/autocmd.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*autocmd.txt* For Vim version 8.2. Last change: 2020 Jun 10
1+
*autocmd.txt* For Vim version 8.2. Last change: 2020 Aug 02
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1432,8 +1432,8 @@ name!
14321432
:aug[roup]! {name} Delete the autocmd group {name}. Don't use
14331433
this if there is still an autocommand using
14341434
this group! You will get a warning if doing
1435-
it anyway. when the group is the current group
1436-
you will get error E936.
1435+
it anyway. When the group is the current
1436+
group you will get error E936.
14371437

14381438
To enter autocommands for a specific group, use this method:
14391439
1. Select the group with ":augroup {name}".

runtime/doc/develop.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*develop.txt* For Vim version 8.2. Last change: 2020 Apr 13
1+
*develop.txt* For Vim version 8.2. Last change: 2020 Jul 27
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -34,8 +34,8 @@ balance must be found between them.
3434
VIM IS... VI COMPATIBLE *design-compatible*
3535

3636
First of all, it should be possible to use Vim as a drop-in replacement for
37-
Vi. When the user wants to, he can use Vim in compatible mode and hardly
38-
notice any difference with the original Vi.
37+
Vi. When the user wants to, Vim can be used in compatible mode and hardly
38+
any differences with the original Vi will be noticed.
3939

4040
Exceptions:
4141
- We don't reproduce obvious Vi bugs in Vim.

runtime/doc/eval.txt

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*eval.txt* For Vim version 8.2. Last change: 2020 Aug 01
1+
*eval.txt* For Vim version 8.2. Last change: 2020 Aug 07
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4907,31 +4907,32 @@ getbufinfo([{dict}])
49074907

49084908
Each returned List item is a dictionary with the following
49094909
entries:
4910-
bufnr buffer number.
4910+
bufnr Buffer number.
49114911
changed TRUE if the buffer is modified.
4912-
changedtick number of changes made to the buffer.
4912+
changedtick Number of changes made to the buffer.
49134913
hidden TRUE if the buffer is hidden.
4914-
lastused timestamp in seconds, like
4914+
lastused Timestamp in seconds, like
49154915
|localtime()|, when the buffer was
49164916
last used.
49174917
{only with the |+viminfo| feature}
49184918
listed TRUE if the buffer is listed.
4919-
lnum current line number in buffer.
4920-
linecount number of lines in the buffer (only
4919+
lnum Line number used for the buffer when
4920+
opened in the current window.
4921+
linecount Number of lines in the buffer (only
49214922
valid when loaded)
49224923
loaded TRUE if the buffer is loaded.
4923-
name full path to the file in the buffer.
4924-
signs list of signs placed in the buffer.
4924+
name Full path to the file in the buffer.
4925+
signs List of signs placed in the buffer.
49254926
Each list item is a dictionary with
49264927
the following fields:
49274928
id sign identifier
49284929
lnum line number
49294930
name sign name
4930-
variables a reference to the dictionary with
4931+
variables A reference to the dictionary with
49314932
buffer-local variables.
4932-
windows list of |window-ID|s that display this
4933+
windows List of |window-ID|s that display this
49334934
buffer
4934-
popups list of popup |window-ID|s that
4935+
popups List of popup |window-ID|s that
49354936
display this buffer
49364937

49374938
Examples: >
@@ -5458,7 +5459,7 @@ getloclist({nr} [, {what}]) *getloclist()*
54585459
:echo getloclist(5, {'filewinid': 0})
54595460

54605461

5461-
getmarklist([{expr}] *getmarklist()*
5462+
getmarklist([{expr}]) *getmarklist()*
54625463
Without the {expr} argument returns a |List| with information
54635464
about all the global marks. |mark|
54645465

@@ -8721,7 +8722,8 @@ searchcount([{options}]) *searchcount()*
87218722
pos |List| `[lnum, col, off]` value
87228723
when recomputing the result.
87238724
this changes "current" result
8724-
value. see |cursor()|, |getpos()
8725+
value. see |cursor()|,
8726+
|getpos()|
87258727
(default: cursor's position)
87268728

87278729

@@ -9123,7 +9125,7 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()*
91239125
argument is ignored. See below for the supported items in
91249126
{what}.
91259127
*setqflist-what*
9126-
When {what} is not present, the items in {list} or used. Each
9128+
When {what} is not present, the items in {list} are used. Each
91279129
item must be a dictionary. Non-dictionary items in {list} are
91289130
ignored. Each dictionary item can contain the following
91299131
entries:
@@ -9344,7 +9346,7 @@ settagstack({nr}, {dict} [, {action}]) *settagstack()*
93449346

93459347
Returns zero for success, -1 for failure.
93469348

9347-
Examples (for more examples see |tagstack-examples||):
9349+
Examples (for more examples see |tagstack-examples|):
93489350
Empty the tag stack of window 3: >
93499351
call settagstack(3, {'items' : []})
93509352

@@ -10144,7 +10146,7 @@ swapname({expr}) *swapname()*
1014410146
The result is the swap file path of the buffer {expr}.
1014510147
For the use of {expr}, see |bufname()| above.
1014610148
If buffer {expr} is the current buffer, the result is equal to
10147-
|:swapname| (unless no swap file).
10149+
|:swapname| (unless there is no swap file).
1014810150
If buffer {expr} has no swap file, returns an empty string.
1014910151

1015010152
Can also be used as a |method|: >
@@ -10367,8 +10369,13 @@ tabpagebuflist([{arg}]) *tabpagebuflist()*
1036710369
tabpagenr([{arg}]) *tabpagenr()*
1036810370
The result is a Number, which is the number of the current
1036910371
tab page. The first tab page has number 1.
10370-
When the optional argument is "$", the number of the last tab
10371-
page is returned (the tab page count).
10372+
10373+
The optional argument {arg} supports the following values:
10374+
$ the number of the last tab page (the tab page
10375+
count).
10376+
# the number of the last accessed tab page
10377+
(where |g<Tab>| goes to). if there is no
10378+
previous tab page 0 is returned.
1037210379
The number can be used with the |:tab| command.
1037310380

1037410381

runtime/doc/gui_w32.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ with the Intellimouse driver 2.2 and when "Universal Scrolling" is turned on.
451451

452452
XPM support *w32-xpm-support*
453453

454-
GVim can be build on MS-Windows with support for XPM files. |+xpm_w32|
454+
GVim can be built on MS-Windows with support for XPM files. |+xpm_w32|
455455
See the Make_mvc.mak file for instructions, search for XPM.
456456

457457
To try out if XPM support works do this: >

runtime/doc/helphelp.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*helphelp.txt* For Vim version 8.2. Last change: 2020 Mar 01
1+
*helphelp.txt* For Vim version 8.2. Last change: 2020 Jul 27
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -369,14 +369,16 @@ highlighting. So do these:
369369
You can find the details in $VIMRUNTIME/syntax/help.vim
370370

371371
*inclusion*
372-
Some people make a big deal about using "his" when referring to the user,
373-
thinking it means we assume the user is male. That is of course not the case,
374-
it's just a habit of writing help text, which quite often is many years old.
375-
Also, a lot of the text is written by contributors for who English is not
376-
their first language. We do not make any assumptions about the gender of the
377-
user, no matter how the text is phrased. And we do not want to waste time on
378-
this discussion. The goal is that the reader understands how Vim works, the
379-
exact wording is secondary.
372+
Vim is for everybody, no matter race, gender or anything. Some people make a
373+
big deal about using "he" or "his" when referring to the user, thinking it
374+
means we assume the user is male. That is not the case, it's just a habit of
375+
writing help text, which quite often is many years old. Also, a lot of the
376+
text is written by contributors for whom English is not their first language.
377+
We do not make any assumptions about the gender of the user, no matter how the
378+
text is phrased. Some people have suggested using "they", but that is not
379+
regular English. We do not want to spend much time on this discussion. The
380+
goal is that the reader understands how Vim works, the exact wording is
381+
secondary.
380382

381383

382384
vim:tw=78:ts=8:noet:ft=help:norl:

runtime/doc/if_lua.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ Vim evaluation and command execution, and others.
199199
returns it. Note that the buffer is not set as
200200
current.
201201

202-
vim.call({name} [,{args}])
203-
Proxy to call Vim function named {name} with
202+
vim.call({name} [, {args}])
203+
Proxy to call Vim function named {name} with
204204
arguments {args}. Example: >
205205
:lua print(vim.call('has', 'timers'))
206206
<

0 commit comments

Comments
 (0)