Skip to content

Commit 4b008ec

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents b258c88 + 6521405 commit 4b008ec

208 files changed

Lines changed: 8742 additions & 1610 deletions

File tree

Some content is hidden

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

.github/workflows/coverity.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,22 @@ jobs:
1515
CC: gcc
1616
CFLAGS: -Wno-deprecated-declarations
1717
DEBIAN_FRONTEND: noninteractive
18+
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
1819

1920
steps:
2021
- name: Checkout repository from github
22+
if: env.TOKEN
2123
uses: actions/checkout@v3
2224

2325
- name: Download Coverity
26+
if: env.TOKEN
2427
run: |
2528
wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=vim" -O coverity_tool.tgz
2629
mkdir cov-scan
2730
tar ax -f coverity_tool.tgz --strip-components=1 -C cov-scan
28-
env:
29-
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
3031
3132
- name: Install packages
33+
if: env.TOKEN
3234
run: |
3335
sudo apt update && sudo apt install -y \
3436
autoconf \
@@ -47,6 +49,7 @@ jobs:
4749
libsodium-dev
4850
4951
- name: Set up environment
52+
if: env.TOKEN
5053
run: |
5154
echo "$(pwd)/cov-scan/bin" >> $GITHUB_PATH
5255
(
@@ -55,17 +58,20 @@ jobs:
5558
) >> $GITHUB_ENV
5659
5760
- name: Configure
61+
if: env.TOKEN
5862
run: |
5963
./configure --with-features=huge ${CONFOPT} --enable-fail-if-missing
6064
# Append various warning flags to CFLAGS.
6165
sed -i -f ci/config.mk.sed src/auto/config.mk
6266
sed -i -f ci/config.mk.${CC}.sed src/auto/config.mk
6367
6468
- name: Build/scan vim
69+
if: env.TOKEN
6570
run: |
6671
cov-build --dir cov-int make -j${NPROC}
6772
6873
- name: Submit results
74+
if: env.TOKEN
6975
run: |
7076
tar zcf cov-scan.tgz cov-int
7177
curl --form token=$TOKEN \
@@ -75,5 +81,4 @@ jobs:
7581
--form description="Automatic GHA scan" \
7682
'https://scan.coverity.com/builds?project=vim'
7783
env:
78-
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
7984
EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }}

Filelist

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,11 @@ SRC_ALL = \
8888
src/job.c \
8989
src/json.c \
9090
src/json_test.c \
91+
src/keymap.h \
9192
src/kword_test.c \
9293
src/list.c \
9394
src/locale.c \
94-
src/keymap.h \
95+
src/logfile.c \
9596
src/macros.h \
9697
src/main.c \
9798
src/map.c \
@@ -162,6 +163,7 @@ SRC_ALL = \
162163
src/version.h \
163164
src/vim.h \
164165
src/vim9.h \
166+
src/vim9class.c \
165167
src/vim9cmds.c \
166168
src/vim9compile.c \
167169
src/vim9execute.c \
@@ -274,6 +276,7 @@ SRC_ALL = \
274276
src/proto/json.pro \
275277
src/proto/list.pro \
276278
src/proto/locale.pro \
279+
src/proto/logfile.pro \
277280
src/proto/main.pro \
278281
src/proto/map.pro \
279282
src/proto/mark.pro \
@@ -325,6 +328,7 @@ SRC_ALL = \
325328
src/proto/usercmd.pro \
326329
src/proto/userfunc.pro \
327330
src/proto/version.pro \
331+
src/proto/vim9class.pro \
328332
src/proto/vim9cmds.pro \
329333
src/proto/vim9compile.pro \
330334
src/proto/vim9execute.pro \

runtime/autoload/dist/ft.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,8 @@ export def SetFileTypeSH(name: string)
712712
if exists("b:is_sh")
713713
unlet b:is_sh
714714
endif
715-
elseif name =~ '\<sh\>'
715+
elseif name =~ '\<sh\>' || name =~ '\<dash\>'
716+
# Ubuntu links "sh" to "dash", thus it is expected to work the same way
716717
b:is_sh = 1
717718
if exists("b:is_kornshell")
718719
unlet b:is_kornshell

runtime/autoload/dist/script.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ def DetectFromHashBang(firstline: string)
5353
name = 'wish'
5454
endif
5555

56-
# Bourne-like shell scripts: bash bash2 ksh ksh93 sh
57-
if name =~ '^\(bash\d*\|\|ksh\d*\|sh\)\>'
56+
# Bourne-like shell scripts: bash bash2 dash ksh ksh93 sh
57+
if name =~ '^\(bash\d*\|dash\|ksh\d*\|sh\)\>'
5858
call dist#ft#SetFileTypeSH(line1)
5959

6060
# csh scripts

runtime/doc/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ DOCS = \
162162
version9.txt \
163163
vi_diff.txt \
164164
vim9.txt \
165+
vim9class.txt \
165166
visual.txt \
166167
windows.txt \
167168
workshop.txt
@@ -314,6 +315,7 @@ HTMLS = \
314315
vi_diff.html \
315316
vimindex.html \
316317
vim9.html \
318+
vim9class.html \
317319
visual.html \
318320
windows.html \
319321
workshop.html

runtime/doc/autocmd.txt

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*autocmd.txt* For Vim version 9.0. Last change: 2022 May 24
1+
*autocmd.txt* For Vim version 9.0. Last change: 2022 Nov 22
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1066,8 +1066,8 @@ QuickFixCmdPre Before a quickfix command is run (|:make|,
10661066
QuickFixCmdPost Like QuickFixCmdPre, but after a quickfix
10671067
command is run, before jumping to the first
10681068
location. For |:cfile| and |:lfile| commands
1069-
it is run after error file is read and before
1070-
moving to the first error.
1069+
it is run after the error file is read and
1070+
before moving to the first error.
10711071
See |QuickFixCmdPost-example|.
10721072
*QuitPre*
10731073
QuitPre When using `:quit`, `:wq` or `:qall`, before
@@ -1350,8 +1350,9 @@ VimSuspend When the Vim instance is suspended. Only when
13501350
CTRL-Z was typed inside Vim, or when the SIGTSTP
13511351
signal was sent to Vim, but not for SIGSTOP.
13521352
*WinClosed*
1353-
WinClosed After closing a window. The pattern is
1354-
matched against the |window-ID|. Both
1353+
WinClosed When closing a window, just before it is
1354+
removed from the window layout. The pattern
1355+
is matched against the |window-ID|. Both
13551356
<amatch> and <afile> are set to the
13561357
|window-ID|. Non-recursive (event cannot
13571358
trigger itself).
@@ -1379,33 +1380,42 @@ WinNew When a new window was created. Not done for
13791380
Before a WinEnter event.
13801381

13811382
*WinScrolled*
1382-
WinScrolled After scrolling the content of a window or
1383-
resizing a window in the current tab page.
1384-
1385-
When more than one window scrolled or resized
1386-
only one WinScrolled event is triggered. You
1387-
can use the `winlayout()` and `getwininfo()`
1388-
functions to see what changed.
1383+
WinScrolled After any window in the current tab page
1384+
scrolled the text (horizontally or vertically)
1385+
or changed width or height. See
1386+
|win-scrolled-resized|.
13891387

13901388
The pattern is matched against the |window-ID|
13911389
of the first window that scrolled or resized.
13921390
Both <amatch> and <afile> are set to the
13931391
|window-ID|.
13941392

1393+
|v:event| is set with information about size
1394+
and scroll changes. |WinScrolled-event|
1395+
13951396
Only starts triggering after startup finished
13961397
and the first screen redraw was done.
1398+
Does not trigger when defining the first
1399+
WinScrolled or WinResized event, but may
1400+
trigger when adding more.
13971401

13981402
Non-recursive: the event will not trigger
13991403
while executing commands for the WinScrolled
14001404
event. However, if the command causes a
14011405
window to scroll or change size, then another
14021406
WinScrolled event will be triggered later.
14031407

1404-
Does not trigger when the command is added,
1405-
only after the first scroll or resize.
1406-
*E1312*
1407-
It is not allowed to change the window layout
1408-
here (split, close or move windows).
1408+
1409+
*WinResized*
1410+
WinResized After a window in the current tab page changed
1411+
width or height.
1412+
See |win-scrolled-resized|.
1413+
1414+
|v:event| is set with information about size
1415+
changes. |WinResized-event|
1416+
1417+
Same behavior as |WinScrolled| for the
1418+
pattern, triggering and recursiveness.
14091419

14101420
==============================================================================
14111421
6. Patterns *autocmd-patterns* *{aupat}*

runtime/doc/builtin.txt

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*builtin.txt* For Vim version 9.0. Last change: 2022 Nov 14
1+
*builtin.txt* For Vim version 9.0. Last change: 2022 Nov 21
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -208,6 +208,7 @@ get({func}, {what}) any get property of funcref/partial {func}
208208
getbufinfo([{buf}]) List information about buffers
209209
getbufline({buf}, {lnum} [, {end}])
210210
List lines {lnum} to {end} of buffer {buf}
211+
getbufoneline({buf}, {lnum}) String line {lnum} of buffer {buf}
211212
getbufvar({buf}, {varname} [, {def}])
212213
any variable {varname} in buffer {buf}
213214
getchangelist([{buf}]) List list of change list items
@@ -3206,7 +3207,8 @@ getbufinfo([{dict}])
32063207
getbufline({buf}, {lnum} [, {end}])
32073208
Return a |List| with the lines starting from {lnum} to {end}
32083209
(inclusive) in the buffer {buf}. If {end} is omitted, a
3209-
|List| with only the line {lnum} is returned.
3210+
|List| with only the line {lnum} is returned. See
3211+
`getbufoneline()` for only getting the line.
32103212

32113213
For the use of {buf}, see |bufname()| above.
32123214

@@ -3229,6 +3231,11 @@ getbufline({buf}, {lnum} [, {end}])
32293231
32303232
< Can also be used as a |method|: >
32313233
GetBufnr()->getbufline(lnum)
3234+
<
3235+
*getbufoneline()*
3236+
getbufoneline({buf}, {lnum})
3237+
Just like `getbufline()` but only get one line and return it
3238+
as a string.
32323239

32333240
getbufvar({buf}, {varname} [, {def}]) *getbufvar()*
32343241
The result is the value of option or local buffer variable
@@ -3773,7 +3780,8 @@ getline({lnum} [, {end}])
37733780
< Can also be used as a |method|: >
37743781
ComputeLnum()->getline()
37753782
3776-
< To get lines from another buffer see |getbufline()|
3783+
< To get lines from another buffer see |getbufline()| and
3784+
|getbufoneline()|
37773785

37783786
getloclist({nr} [, {what}]) *getloclist()*
37793787
Returns a |List| with all the entries in the location list for
@@ -5566,6 +5574,10 @@ map({expr1}, {expr2}) *map()*
55665574
If {expr2} is a |Funcref| it is called with two arguments:
55675575
1. The key or the index of the current item.
55685576
2. the value of the current item.
5577+
With a legacy script lambda you don't get an error if it only
5578+
accepts one argument, but with a Vim9 lambda you get "E1106:
5579+
One argument too many", the number of arguments must match.
5580+
55695581
The function must return the new value of the item. Example
55705582
that changes each value by "key-value": >
55715583
func KeyValue(key, val)
@@ -7932,29 +7944,38 @@ setbufvar({buf}, {varname}, {val}) *setbufvar()*
79327944
79337945
setcellwidths({list}) *setcellwidths()*
79347946
Specify overrides for cell widths of character ranges. This
7935-
tells Vim how wide characters are, counted in screen cells.
7936-
This overrides 'ambiwidth'. Example: >
7937-
setcellwidths([[0xad, 0xad, 1],
7938-
\ [0x2194, 0x2199, 2]])
7939-
7940-
< *E1109* *E1110* *E1111* *E1112* *E1113* *E1114*
7941-
The {list} argument is a list of lists with each three
7942-
numbers. These three numbers are [low, high, width]. "low"
7943-
and "high" can be the same, in which case this refers to one
7944-
character. Otherwise it is the range of characters from "low"
7945-
to "high" (inclusive). "width" is either 1 or 2, indicating
7946-
the character width in screen cells.
7947-
An error is given if the argument is invalid, also when a
7948-
range overlaps with another.
7947+
tells Vim how wide characters are when displayed in the
7948+
terminal, counted in screen cells. The values override
7949+
'ambiwidth'. Example: >
7950+
call setcellwidths([
7951+
\ [0x111, 0x111, 1],
7952+
\ [0x2194, 0x2199, 2],
7953+
\ ])
7954+
7955+
< The {list} argument is a List of Lists with each three
7956+
numbers: [{low}, {high}, {width}]. *E1109* *E1110*
7957+
{low} and {high} can be the same, in which case this refers to
7958+
one character. Otherwise it is the range of characters from
7959+
{low} to {high} (inclusive). *E1111* *E1114*
79497960
Only characters with value 0x100 and higher can be used.
79507961

7962+
{width} must be either 1 or 2, indicating the character width
7963+
in screen cells. *E1112*
7964+
An error is given if the argument is invalid, also when a
7965+
range overlaps with another. *E1113*
7966+
79517967
If the new value causes 'fillchars' or 'listchars' to become
79527968
invalid it is rejected and an error is given.
79537969

7954-
To clear the overrides pass an empty list: >
7970+
To clear the overrides pass an empty {list}: >
79557971
setcellwidths([]);
7972+
79567973
< You can use the script $VIMRUNTIME/tools/emoji_list.vim to see
7957-
the effect for known emoji characters.
7974+
the effect for known emoji characters. Move the cursor
7975+
through the text to check if the cell widths of your terminal
7976+
match with what Vim knows about each emoji. If it doesn't
7977+
look right you need to adjust the {list} argument.
7978+
79587979

79597980
setcharpos({expr}, {list}) *setcharpos()*
79607981
Same as |setpos()| but uses the specified column number as the

runtime/doc/change.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*change.txt* For Vim version 9.0. Last change: 2022 Sep 13
1+
*change.txt* For Vim version 9.0. Last change: 2022 Nov 20
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar

runtime/doc/channel.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,9 @@ ch_info({handle}) *ch_info()*
618618
ch_log({msg} [, {handle}]) *ch_log()*
619619
Write String {msg} in the channel log file, if it was opened
620620
with |ch_logfile()|.
621+
The text "ch_log():" is prepended to the message to make clear
622+
it came from this function call and make it easier to find in
623+
the log file.
621624
When {handle} is passed the channel number is used for the
622625
message.
623626
{handle} can be a Channel or a Job that has a Channel. The

runtime/doc/digraph.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*digraph.txt* For Vim version 9.0. Last change: 2021 Jul 19
1+
*digraph.txt* For Vim version 9.0. Last change: 2022 Nov 22
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -162,7 +162,7 @@ These are the RFC1345 digraphs for the one-byte characters. See the output of
162162
":digraphs" for the others.
163163

164164
EURO
165-
165+
*euro* *euro-digraph*
166166
Exception: RFC1345 doesn't specify the euro sign. In Vim the digraph =e was
167167
added for this. Note the difference between latin1, where the digraph Cu is
168168
used for the currency sign, and latin9 (iso-8859-15), where the digraph =e is

0 commit comments

Comments
 (0)