Skip to content

Commit 401db76

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 7066d50 + d3f8a9e commit 401db76

50 files changed

Lines changed: 687 additions & 184 deletions

Some content is hidden

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

runtime/doc/options.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3262,6 +3262,9 @@ A jump table for the options with a short description can be found at |Q_op|.
32623262
stlnc:c ' ' or '=' statusline of the non-current windows
32633263
vert:c '|' vertical separators |:vsplit|
32643264
fold:c '-' filling 'foldtext'
3265+
foldopen:c '-' mark the beginning of a fold
3266+
foldclose:c '+' show a closed fold
3267+
foldsep:c '|' open fold middle character
32653268
diff:c '-' deleted lines of the 'diff' option
32663269
eob:c '~' empty lines below the end of a buffer
32673270

@@ -4949,7 +4952,7 @@ A jump table for the options with a short description can be found at |Q_op|.
49494952

49504953
*'listchars'* *'lcs'*
49514954
'listchars' 'lcs' string (default "eol:$")
4952-
global
4955+
global or local to window |global-local|
49534956
Strings to use in 'list' mode and for the |:list| command. It is a
49544957
comma separated list of string settings.
49554958
*lcs-eol*

runtime/doc/repeat.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,13 +354,15 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
354354
Vim version, or update Vim to a newer version. See
355355
|vimscript-version| for what changed between versions.
356356

357-
:vim9[script] [noclear] *:vim9* *:vim9script*
357+
:vim9s[cript] [noclear] *:vim9s* *:vim9script*
358358
Marks a script file as containing |Vim9-script|
359359
commands. Also see |vim9-namespace|.
360360
Must be the first command in the file.
361361
For [noclear] see |vim9-reload|.
362362
Without the |+eval| feature this changes the syntax
363363
for some commands.
364+
See |:vim9cmd| for executing one command with Vim9
365+
syntax and semantics.
364366

365367
*:scr* *:scriptnames*
366368
:scr[iptnames] List all sourced script names, in the order they were

runtime/doc/vim9.txt

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ The Vim9 script syntax and semantics are used in:
5151
- a function defined with the `:def` command
5252
- a script file where the first command is `vim9script`
5353
- an autocommand defined in the context of the above
54+
- a command prefixed with the `vim9cmd` command modifier
5455

5556
When using `:function` in a Vim9 script file the legacy syntax is used, with
5657
the highest |scriptversion|. However, this can be confusing and is therefore
@@ -60,6 +61,12 @@ Vim9 script and legacy Vim script can be mixed. There is no requirement to
6061
rewrite old scripts, they keep working as before. You may want to use a few
6162
`:def` functions for code that needs to be fast.
6263

64+
*:vim9* *:vim9cmd*
65+
:vim9[cmd] {cmd}
66+
Execute {cmd} using Vim9 script syntax and semantics.
67+
Useful when typing a command and in a legacy script or
68+
function.
69+
6370
==============================================================================
6471

6572
2. Differences from legacy Vim script *vim9-differences*
@@ -1044,9 +1051,9 @@ that you don't do that.
10441051
Namespace ~
10451052
*vim9-namespace*
10461053
To recognize a file that can be imported the `vim9script` statement must
1047-
appear as the first statement in the file. It tells Vim to interpret the
1048-
script in its own namespace, instead of the global namespace. If a file
1049-
starts with: >
1054+
appear as the first statement in the file (see |vim9-mix| for an exception).
1055+
It tells Vim to interpret the script in its own namespace, instead of the
1056+
global namespace. If a file starts with: >
10501057
vim9script
10511058
var myvar = 'yes'
10521059
Then "myvar" will only exist in this file. While without `vim9script` it would
@@ -1066,6 +1073,27 @@ Vim default value, like with: >
10661073
One of the effects is that |line-continuation| is always enabled.
10671074
The original value of 'cpoptions' is restored at the end of the script.
10681075

1076+
*vim9-mix*
1077+
There is one way to use both legacy and Vim9 syntax in one script file: >
1078+
" comments may go here
1079+
if !has('vim9script')
1080+
" legacy script commands go here
1081+
finish
1082+
endif
1083+
vim9script
1084+
# Vim9 script commands go here
1085+
This allows for writing a script that takes advantage of the Vim9 script
1086+
syntax if possible, but will also work on an Vim version without it.
1087+
1088+
This can only work in two ways:
1089+
1. The "if" statement evaluates to false, the commands up to `endif` are
1090+
skipped and `vim9script` is then the first command actually executed.
1091+
2. The "if" statement evaluates to true, the commands up to `endif` are
1092+
executed and `finish` bails out before reaching `vim9script`.
1093+
1094+
TODO: The "vim9script" feature does not exist yet, it will only be added once
1095+
the Vim9 script syntax has been fully implemented.
1096+
10691097

10701098
Export ~
10711099
*:export* *:exp*

runtime/filetype.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ au BufNewFile,BufRead *.bc setf bc
216216
" BDF font
217217
au BufNewFile,BufRead *.bdf setf bdf
218218

219+
" Beancount
220+
au BufNewFile,BufRead *.beancount setf beancount
221+
219222
" BibTeX bibliography database file
220223
au BufNewFile,BufRead *.bib setf bib
221224

@@ -1488,6 +1491,9 @@ au BufNewFile,BufRead *.sdl,*.pr setf sdl
14881491
" sed
14891492
au BufNewFile,BufRead *.sed setf sed
14901493

1494+
" svelte
1495+
au BufNewFile,BufRead *.svelte setf svelte
1496+
14911497
" Sieve (RFC 3028, 5228)
14921498
au BufNewFile,BufRead *.siv,*.sieve setf sieve
14931499

src/buffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4559,7 +4559,7 @@ build_stl_str_hl(
45594559
case STL_VIRTCOL_ALT:
45604560
// In list mode virtcol needs to be recomputed
45614561
virtcol = wp->w_virtcol;
4562-
if (wp->w_p_list && lcs_tab1 == NUL)
4562+
if (wp->w_p_list && wp->w_lcs_chars.tab1 == NUL)
45634563
{
45644564
wp->w_p_list = FALSE;
45654565
getvcol(wp, &wp->w_cursor, NULL, &virtcol, NULL);

src/charset.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -753,15 +753,15 @@ vim_strnsize(char_u *s, int len)
753753

754754
#ifdef FEAT_VARTABS
755755
# define RET_WIN_BUF_CHARTABSIZE(wp, buf, p, col) \
756-
if (*(p) == TAB && (!(wp)->w_p_list || lcs_tab1)) \
756+
if (*(p) == TAB && (!(wp)->w_p_list || wp->w_lcs_chars.tab1)) \
757757
{ \
758758
return tabstop_padding(col, (buf)->b_p_ts, (buf)->b_p_vts_array); \
759759
} \
760760
else \
761761
return ptr2cells(p);
762762
#else
763763
# define RET_WIN_BUF_CHARTABSIZE(wp, buf, p, col) \
764-
if (*(p) == TAB && (!(wp)->w_p_list || lcs_tab1)) \
764+
if (*(p) == TAB && (!(wp)->w_p_list || wp->w_lcs_chars.tab1)) \
765765
{ \
766766
int ts; \
767767
ts = (buf)->b_p_ts; \
@@ -1153,7 +1153,7 @@ win_nolbr_chartabsize(
11531153
{
11541154
int n;
11551155

1156-
if (*s == TAB && (!wp->w_p_list || lcs_tab1))
1156+
if (*s == TAB && (!wp->w_p_list || wp->w_lcs_chars.tab1))
11571157
{
11581158
# ifdef FEAT_VARTABS
11591159
return tabstop_padding(col, wp->w_buffer->b_p_ts,
@@ -1248,7 +1248,7 @@ getvcol(
12481248
* use a simple loop.
12491249
* Also use this when 'list' is set but tabs take their normal size.
12501250
*/
1251-
if ((!wp->w_p_list || lcs_tab1 != NUL)
1251+
if ((!wp->w_p_list || wp->w_lcs_chars.tab1 != NUL)
12521252
#ifdef FEAT_LINEBREAK
12531253
&& !wp->w_p_lbr && *get_showbreak_value(wp) == NUL && !wp->w_p_bri
12541254
#endif

0 commit comments

Comments
 (0)