Skip to content

Commit

Permalink
Merge remote-tracking branch 'vim/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ychin committed Oct 13, 2022
2 parents 80a7ca9 + 4b6172e commit 6500a0c
Show file tree
Hide file tree
Showing 93 changed files with 1,475 additions and 671 deletions.
6 changes: 3 additions & 3 deletions runtime/doc/builtin.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*builtin.txt* For Vim version 9.0. Last change: 2022 Sep 30
*builtin.txt* For Vim version 9.0. Last change: 2022 Oct 10


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -1882,10 +1882,10 @@ cursor({list})
|setcursorcharpos()|.

Does not change the jumplist.
{lnum} is used like with |getline()|.
{lnum} is used like with |getline()|, except that if {lnum} is
zero, the cursor will stay in the current line.
If {lnum} is greater than the number of lines in the buffer,
the cursor will be positioned at the last line in the buffer.
If {lnum} is zero, the cursor will stay in the current line.
If {col} is greater than the number of bytes in the line,
the cursor will be positioned at the last character in the
line.
Expand Down
2 changes: 1 addition & 1 deletion runtime/doc/eval.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 9.0. Last change: 2022 Sep 17
*eval.txt* For Vim version 9.0. Last change: 2022 Oct 07


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down
2 changes: 2 additions & 0 deletions runtime/doc/options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7211,6 +7211,8 @@ A jump table for the options with a short description can be found at |Q_op|.
c don't give |ins-completion-menu| messages. For example,
"-- XXX completion (YYY)", "match 1 of 2", "The only match",
"Pattern not found", "Back at original", etc.
C don't give messages while scanning for ins-completion items,
for instance "scanning tags"
q use "recording" instead of "recording @a"
F don't give the file info when editing a file, like `:silent`
was used for the command; note that this also affects messages
Expand Down
5 changes: 5 additions & 0 deletions runtime/doc/rileft.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ encoded for every character (or group of characters) are not supported either
as this kind of support is out of the scope of a simple addition to an
existing editor (and it's not sanctioned by Unicode either).

As many people working on the code do not use the right-to-left mode, this
feature may not work in some situations. If you can describe what is wrong
and how it would work when fixed, please create an issue on github, see
|bug-reports|.


Highlights
----------
Expand Down
5 changes: 2 additions & 3 deletions runtime/doc/terminal.txt
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,8 @@ way to kill or interrupt the job. For example: >
So long as the job is running the window behaves like it contains a modified
buffer. Trying to close the window with `CTRL-W :quit` fails. When using
`CTRL-W :quit!` the job is ended. The text in the window is lost. The buffer
still exists, but getting it in a window with `:buffer` will show an empty
buffer.
`CTRL-W :quit!` the job is ended. The text in the window is lost, the buffer
is deleted. With `CTRL-W :bunload!` the buffer remains but will be empty.

Trying to close the window with `CTRL-W :close` also fails. Using
`CTRL-W :close!` will close the window and make the buffer hidden.
Expand Down
20 changes: 13 additions & 7 deletions runtime/doc/textprop.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ prop_add({lnum}, {col}, {props})
GetLnum()->prop_add(col, props)
<
*prop_add_list()*
prop_add_list({props}, [[{lnum}, {col}, {end-lnum}, {end-col}], ...])
prop_add_list({props}, [{item}, ...])
Similar to prop_add(), but attaches a text property at
multiple positions in a buffer.

Expand All @@ -237,12 +237,18 @@ prop_add_list({props}, [[{lnum}, {col}, {end-lnum}, {end-col}], ...])
type name of the text property type
All fields except "type" are optional.

The second argument is a List of Lists where each list
specifies the starting and ending position of the text. The
first two items {lnum} and {col} specify the starting position
of the text where the property will be attached and the last
two items {end-lnum} and {end-col} specify the position just
after the text.
The second argument is a List of items, where each {item} is a
list that specifies the starting and ending position of the
text: [{lnum}, {col}, {end-lnum}, {end-col}]
or: [{lnum}, {col}, {end-lnum}, {end-col}, {id}]

The first two items {lnum} and {col} specify the starting
position of the text where the property will be attached.
The next two items {end-lnum} and {end-col} specify the
position just after the text.
An optional fifth item {id} can be used to give a different ID
to a property. When omitted the ID from {props} is used,
falling back to zero if none are present.

It is not possible to add a text property with a "text" field
here.
Expand Down
4 changes: 3 additions & 1 deletion runtime/doc/vim9.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*vim9.txt* For Vim version 9.0. Last change: 2022 Oct 03
*vim9.txt* For Vim version 9.0. Last change: 2022 Oct 11


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -962,6 +962,8 @@ In compiled Vim9 script you get:
3
Generally, you should not change the list that is iterated over. Make a copy
first if needed.
When looping over a list of lists, the nested lists can be changed. The loop
variable is "final", it cannot be changed but what its value can be changed.
*E1306*
The depth of loops, :for and :while loops added together, cannot exceed 10.

Expand Down
6 changes: 6 additions & 0 deletions runtime/filetype.vim
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,9 @@ au BufNewFile,BufRead *.ch call dist#ft#FTchange()
" ChordPro
au BufNewFile,BufRead *.chopro,*.crd,*.cho,*.crdpro,*.chordpro setf chordpro

" Clang-tidy
au BufNewFile,BufRead .clang-tidy setf yaml

" Clean
au BufNewFile,BufRead *.dcl,*.icl setf clean

Expand Down Expand Up @@ -1750,6 +1753,9 @@ au BufNewFile,BufRead *.sed setf sed
" SubRip
au BufNewFile,BufRead *.srt setf srt

" SubStation Alpha
au BufNewFile,BufRead *.ass,*.ssa setf ssa

" svelte
au BufNewFile,BufRead *.svelte setf svelte

Expand Down
1 change: 1 addition & 0 deletions src/autocmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2096,6 +2096,7 @@ apply_autocmds_group(
|| event == EVENT_DIRCHANGED
|| event == EVENT_DIRCHANGEDPRE
|| event == EVENT_MODECHANGED
|| event == EVENT_MENUPOPUP
|| event == EVENT_USER
|| event == EVENT_WINCLOSED
|| event == EVENT_WINSCROLLED)
Expand Down
22 changes: 17 additions & 5 deletions src/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,8 @@ close_buffer(
unload_buf = TRUE;

#ifdef FEAT_TERMINAL
if (bt_terminal(buf) && (buf->b_nwindows == 1 || del_buf))
// depending on how we get here b_nwindows may already be zero
if (bt_terminal(buf) && (buf->b_nwindows <= 1 || del_buf))
{
CHECK_CURBUF;
if (term_job_running(buf->b_term))
Expand All @@ -550,6 +551,11 @@ close_buffer(

// Wiping out or unloading a terminal buffer kills the job.
free_terminal(buf);

// A terminal buffer is wiped out when job has finished.
del_buf = TRUE;
unload_buf = TRUE;
wipe_buf = TRUE;
}
else
{
Expand All @@ -565,10 +571,16 @@ close_buffer(
}
else
{
// A terminal buffer is wiped out if the job has finished.
del_buf = TRUE;
unload_buf = TRUE;
wipe_buf = TRUE;
if (del_buf || unload_buf)
{
// A terminal buffer is wiped out if the job has finished.
// We only do this when there's an intention to unload the
// buffer. This way, :hide and other similar commands won't
// wipe the buffer.
del_buf = TRUE;
unload_buf = TRUE;
wipe_buf = TRUE;
}
}
CHECK_CURBUF;
}
Expand Down
2 changes: 1 addition & 1 deletion src/charset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,7 @@ win_lbr_chartabsize(
{
int n_extra = (int)STRLEN(p);

cells = text_prop_position(wp, tp,
cells = text_prop_position(wp, tp, vcol,
(vcol + size) % (wp->w_width - col_off) + col_off,
&n_extra, &p, NULL, NULL);
#ifdef FEAT_LINEBREAK
Expand Down
Loading

0 comments on commit 6500a0c

Please sign in to comment.