Skip to content

Commit d235206

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 1943c57 + 5671f3f commit d235206

Some content is hidden

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

76 files changed

+1395
-336
lines changed

runtime/doc/if_lua.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,38 @@ Vim evaluation and command execution, and others.
211211
vim.lua_version The Lua version Vim was compiled with, in the
212212
form {major}.{minor}.{patch}, e.g. "5.1.4".
213213

214+
*lua-vim-variables*
215+
The Vim editor global dictionaries |g:| |w:| |b:| |t:| |v:| can be accessed
216+
from Lua conveniently and idiomatically by referencing the `vim.*` Lua tables
217+
described below. In this way you can easily read and modify global Vimscript
218+
variables from Lua.
219+
220+
Example: >
221+
222+
vim.g.foo = 5 -- Set the g:foo Vimscript variable.
223+
print(vim.g.foo) -- Get and print the g:foo Vimscript variable.
224+
vim.g.foo = nil -- Delete (:unlet) the Vimscript variable.
225+
226+
vim.g *vim.g*
227+
Global (|g:|) editor variables.
228+
Key with no value returns `nil`.
229+
230+
vim.b *vim.b*
231+
Buffer-scoped (|b:|) variables for the current buffer.
232+
Invalid or unset key returns `nil`.
233+
234+
vim.w *vim.w*
235+
Window-scoped (|w:|) variables for the current window.
236+
Invalid or unset key returns `nil`.
237+
238+
vim.t *vim.t*
239+
Tabpage-scoped (|t:|) variables for the current tabpage.
240+
Invalid or unset key returns `nil`.
241+
242+
vim.v *vim.v*
243+
|v:| variables.
244+
Invalid or unset key returns `nil`.
245+
214246
==============================================================================
215247
3. List userdata *lua-list*
216248

runtime/doc/map.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,8 +1580,11 @@ Example: >
15801580
echo 'hello'
15811581
g:calledMyCommand = true
15821582
}
1583-
No nesting is supported, inline functions cannot be used. Using `:normal`
1584-
directly does not work, you can use it indirectly with `:execute`.
1583+
< *E1231*
1584+
There must be white space before the "{". No nesting is supported, inline
1585+
functions cannot be used. Commands where a "|" may appear in the argument,
1586+
such as commands with an expression argument, cannot be followed by a "|" and
1587+
another command.
15851588

15861589
The replacement text {repl} for a user defined command is scanned for special
15871590
escape sequences, using <...> notation. Escape sequences are replaced with

runtime/doc/options.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8787,7 +8787,7 @@ A jump table for the options with a short description can be found at |Q_op|.
87878787

87888788
*'virtualedit'* *'ve'*
87898789
'virtualedit' 've' string (default "")
8790-
global or local to buffer |global-local|
8790+
global or local to window |global-local|
87918791
A comma separated list of these words:
87928792
block Allow virtual editing in Visual block mode.
87938793
insert Allow virtual editing in Insert mode.

runtime/filetype.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,9 @@ au BufNewFile,BufRead *.ipynb setf json
874874
" JSONC
875875
au BufNewFile,BufRead *.jsonc setf jsonc
876876

877+
" Julia
878+
au BufNewFile,BufRead *.jl setf julia
879+
877880
" Kixtart
878881
au BufNewFile,BufRead *.kix setf kix
879882

@@ -1523,6 +1526,9 @@ au BufNewFile,BufRead *.sbt setf sbt
15231526
" Scilab
15241527
au BufNewFile,BufRead *.sci,*.sce setf scilab
15251528

1529+
" scdoc
1530+
au BufNewFile,BufRead *.scd setf scdoc
1531+
15261532
" SCSS
15271533
au BufNewFile,BufRead *.scss setf scss
15281534

src/arglist.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ alist_set(
148148
return;
149149

150150
alist_clear(al);
151-
if (ga_grow(&al->al_ga, count) == OK)
151+
if (GA_GROW_OK(&al->al_ga, count))
152152
{
153153
for (i = 0; i < count; ++i)
154154
{
@@ -355,7 +355,7 @@ alist_add_list(
355355
int old_argcount = ARGCOUNT;
356356

357357
if (check_arglist_locked() != FAIL
358-
&& ga_grow(&ALIST(curwin)->al_ga, count) == OK)
358+
&& GA_GROW_OK(&ALIST(curwin)->al_ga, count))
359359
{
360360
if (after < 0)
361361
after = 0;
@@ -599,7 +599,7 @@ ex_args(exarg_T *eap)
599599
garray_T *gap = &curwin->w_alist->al_ga;
600600

601601
// ":argslocal": make a local copy of the global argument list.
602-
if (ga_grow(gap, GARGCOUNT) == OK)
602+
if (GA_GROW_OK(gap, GARGCOUNT))
603603
for (i = 0; i < GARGCOUNT; ++i)
604604
if (GARGLIST[i].ae_fname != NULL)
605605
{

src/blob.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,16 +412,19 @@ blob_set_range(blob_T *dest, long n1, long n2, typval_T *src)
412412
* "remove({blob})" function
413413
*/
414414
void
415-
blob_remove(typval_T *argvars, typval_T *rettv)
415+
blob_remove(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg)
416416
{
417+
blob_T *b = argvars[0].vval.v_blob;
417418
int error = FALSE;
418419
long idx;
419420
long end;
420421

422+
if (b != NULL && value_check_lock(b->bv_lock, arg_errmsg, TRUE))
423+
return;
424+
421425
idx = (long)tv_get_number_chk(&argvars[1], &error);
422426
if (!error)
423427
{
424-
blob_T *b = argvars[0].vval.v_blob;
425428
int len = blob_len(b);
426429
char_u *p;
427430

src/buffer.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2392,7 +2392,6 @@ free_buf_options(
23922392
#endif
23932393
clear_string_option(&buf->b_p_bkc);
23942394
clear_string_option(&buf->b_p_menc);
2395-
clear_string_option(&buf->b_p_ve);
23962395
}
23972396

23982397
/*

src/channel.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,7 @@ ch_log(channel_T *ch, const char *fmt, ...)
229229
#endif
230230

231231
static void
232-
ch_error(channel_T *ch, const char *fmt, ...)
233-
#ifdef USE_PRINTF_FORMAT_ATTRIBUTE
234-
__attribute__((format(printf, 2, 3)))
235-
#endif
236-
;
232+
ch_error(channel_T *ch, const char *fmt, ...) ATTRIBUTE_FORMAT_PRINTF(2, 3);
237233

238234
static void
239235
ch_error(channel_T *ch, const char *fmt, ...)

src/drawline.c

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,14 @@ win_line(
10051005
// Skip this quickly when working on the text.
10061006
if (draw_state != WL_LINE)
10071007
{
1008+
#ifdef FEAT_SYN_HL
1009+
if (cul_screenline)
1010+
{
1011+
cul_attr = 0;
1012+
line_attr = line_attr_save;
1013+
}
1014+
#endif
1015+
10081016
#ifdef FEAT_CMDWIN
10091017
if (draw_state == WL_CMDLINE - 1 && n_extra == 0)
10101018
{
@@ -1194,13 +1202,7 @@ win_line(
11941202
char_attr = 0;
11951203
# ifdef FEAT_DIFF
11961204
if (diff_hlf != (hlf_T)0)
1197-
{
11981205
char_attr = HL_ATTR(diff_hlf);
1199-
# ifdef FEAT_SYN_HL
1200-
if (cul_attr != 0)
1201-
char_attr = hl_combine_attr(char_attr, cul_attr);
1202-
# endif
1203-
}
12041206
# endif
12051207
p_extra = NULL;
12061208
c_extra = ' ';
@@ -1297,20 +1299,12 @@ win_line(
12971299
}
12981300
}
12991301
#ifdef FEAT_SYN_HL
1300-
if (cul_screenline)
1302+
if (cul_screenline && draw_state == WL_LINE
1303+
&& vcol >= left_curline_col
1304+
&& vcol < right_curline_col)
13011305
{
1302-
if (draw_state == WL_LINE
1303-
&& vcol >= left_curline_col
1304-
&& vcol < right_curline_col)
1305-
{
1306-
cul_attr = HL_ATTR(HLF_CUL);
1307-
line_attr = cul_attr;
1308-
}
1309-
else
1310-
{
1311-
cul_attr = 0;
1312-
line_attr = line_attr_save;
1313-
}
1306+
cul_attr = HL_ATTR(HLF_CUL);
1307+
line_attr = cul_attr;
13141308
}
13151309
#endif
13161310

src/drawscreen.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,15 +2006,15 @@ win_update(win_T *wp)
20062006
{
20072007
colnr_T fromc, toc;
20082008
#if defined(FEAT_LINEBREAK)
2009-
int save_ve_flags = curbuf->b_ve_flags;
2009+
int save_ve_flags = curwin->w_ve_flags;
20102010

20112011
if (curwin->w_p_lbr)
2012-
curbuf->b_ve_flags = VE_ALL;
2012+
curwin->w_ve_flags = VE_ALL;
20132013
#endif
20142014
getvcols(wp, &VIsual, &curwin->w_cursor, &fromc, &toc);
20152015
++toc;
20162016
#if defined(FEAT_LINEBREAK)
2017-
curbuf->b_ve_flags = save_ve_flags;
2017+
curwin->w_ve_flags = save_ve_flags;
20182018
#endif
20192019
// Highlight to the end of the line, unless 'virtualedit' has
20202020
// "block".

0 commit comments

Comments
 (0)