Skip to content

Commit d65a45d

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 4e69a2d + 0fb286e commit d65a45d

33 files changed

Lines changed: 2211 additions & 1891 deletions

runtime/colors/tools/check_colors.vim

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set cpo&vim
88
func! Test_check_colors()
99
let l:savedview = winsaveview()
1010
call cursor(1,1)
11-
let err={}
11+
let err = {}
1212

1313
" 1) Check g:colors_name is existing
1414
if !search('\<\%(g:\)\?colors_name\>', 'cnW')
@@ -81,36 +81,39 @@ func! Test_check_colors()
8181
\ 'WarningMsg',
8282
\ 'WildMenu',
8383
\ ]
84-
let groups={}
84+
let groups = {}
8585
for group in hi_groups
86-
if search('\c@suppress\s\+'.group, 'cnW')
86+
if search('\c@suppress\s\+\<' .. group .. '\>', 'cnW')
8787
" skip check, if the script contains a line like
8888
" @suppress Visual:
89-
let groups[group] = 'Ignoring '.group
9089
continue
9190
endif
92-
if search('hi\%[ghlight]!\= \+link \+'.group, 'cnW') " Linked group
91+
if search('hi\%[ghlight]!\= \+link \+' .. group, 'cnW') " Linked group
9392
continue
9493
endif
95-
if !search('hi\%[ghlight] \+'.group, 'cnW')
96-
let groups[group] = 'No highlight definition for '.group
94+
if !search('hi\%[ghlight] \+\<' .. group .. '\>', 'cnW')
95+
let groups[group] = 'No highlight definition for ' .. group
9796
continue
9897
endif
99-
if !search('hi\%[ghlight] \+'.group. '.*fg=', 'cnW')
100-
let groups[group] = 'Missing foreground color for '.group
98+
if !search('hi\%[ghlight] \+\<' .. group .. '\>.*[bf]g=', 'cnW')
99+
let groups[group] = 'Missing foreground or background color for ' .. group
101100
continue
102101
endif
103-
if search('hi\%[ghlight] \+'.group. '.*guibg=', 'cnW') &&
104-
\ !search('hi\%[ghlight] \+'.group. '.*ctermbg=', 'cnW')
105-
let groups[group] = 'Missing bg terminal color for '.group
102+
if search('hi\%[ghlight] \+\<' .. group .. '\>.*guibg=', 'cnW') &&
103+
\ !search('hi\%[ghlight] \+\<' .. group .. '\>.*ctermbg=', 'cnW')
104+
\ && group != 'Cursor'
105+
let groups[group] = 'Missing bg terminal color for ' .. group
106106
continue
107107
endif
108-
if !search('hi\%[ghlight] \+'.group. '.*guifg=', 'cnW')
109-
let groups[group] = 'Missing guifg definition for '.group
108+
if !search('hi\%[ghlight] \+\<' .. group .. '\>.*guifg=', 'cnW')
109+
\ && group !~ '^Diff'
110+
let groups[group] = 'Missing guifg definition for ' .. group
110111
continue
111112
endif
112-
if !search('hi\%[ghlight] \+'.group. '.*ctermfg=', 'cnW')
113-
let groups[group] = 'Missing ctermfg definition for '.group
113+
if !search('hi\%[ghlight] \+\<' .. group .. '\>.*ctermfg=', 'cnW')
114+
\ && group !~ '^Diff'
115+
\ && group != 'Cursor'
116+
let groups[group] = 'Missing ctermfg definition for ' .. group
114117
continue
115118
endif
116119
" do not check for background colors, they could be intentionally left out
@@ -120,10 +123,10 @@ func! Test_check_colors()
120123

121124
" 3) Check, that it does not set background highlighting
122125
" Doesn't ':hi Normal ctermfg=253 ctermfg=233' also set the background sometimes?
123-
let bg_set='\(set\?\|setl\(ocal\)\?\) .*\(background\|bg\)=\(dark\|light\)'
124-
let bg_let='let \%([&]\%([lg]:\)\?\)\%(background\|bg\)\s*=\s*\([''"]\?\)\w\+\1'
125-
let bg_pat='\%('.bg_set. '\|'.bg_let.'\)'
126-
let line=search(bg_pat, 'cnW')
126+
let bg_set = '\(set\?\|setl\(ocal\)\?\) .*\(background\|bg\)=\(dark\|light\)'
127+
let bg_let = 'let \%([&]\%([lg]:\)\?\)\%(background\|bg\)\s*=\s*\([''"]\?\)\w\+\1'
128+
let bg_pat = '\%(' .. bg_set .. '\|' .. bg_let .. '\)'
129+
let line = search(bg_pat, 'cnW')
127130
if search(bg_pat, 'cnW')
128131
exe line
129132
if search('hi \U\w\+\s\+\S', 'cbnW')
@@ -145,7 +148,7 @@ func! Test_check_colors()
145148
" if exists("syntax_on")
146149
" syntax reset
147150
" endif
148-
let pat='hi\%[ghlight]\s*clear\n\s*if\s*exists(\([''"]\)syntax_on\1)\n\s*syn\%[tax]\s*reset\n\s*endif'
151+
let pat = 'hi\%[ghlight]\s*clear\n\s*if\s*exists(\([''"]\)syntax_on\1)\n\s*syn\%[tax]\s*reset\n\s*endif'
149152
if !search(pat, 'cnW')
150153
let err['init'] = 'No initialization'
151154
endif
@@ -160,7 +163,7 @@ func! Test_check_colors()
160163
let ft_groups = []
161164
" let group = '\%('.join(hi_groups, '\|').'\)' " More efficient than a for loop, but less informative
162165
for group in hi_groups
163-
let pat='\Chi\%[ghlight]!\= *\%[link] \+\zs'.group.'\w\+\>\ze \+.' " Skips `hi clear`
166+
let pat = '\Chi\%[ghlight]!\= *\%[link] \+\zs' .. group .. '\w\+\>\ze \+.' " Skips `hi clear`
164167
if search(pat, 'cW')
165168
call add(ft_groups, matchstr(getline('.'), pat))
166169
endif
@@ -172,7 +175,7 @@ func! Test_check_colors()
172175

173176
" 8) Were debugPC and debugBreakpoint defined?
174177
for group in ['debugPC', 'debugBreakpoint']
175-
let pat='\Chi\%[ghlight]!\= *\%[link] \+\zs'.group.'\>'
178+
let pat = '\Chi\%[ghlight]!\= *\%[link] \+\zs' .. group .. '\>'
176179
if search(pat, 'cnW')
177180
let line = search(pat, 'cW')
178181
let err['filetype'] = get(err, 'filetype', 'Should not define: ') . matchstr(getline('.'), pat). ' '

runtime/doc/popup.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ Filter functions:
170170
Other:
171171
|popup_getoptions()| get current options for a popup
172172
|popup_getpos()| get actual position and size of a popup
173+
|popup_locate()| find popup window at a screen position
173174

174175

175176
DETAILS *popup-function-details*
@@ -343,6 +344,13 @@ popup_hide({id}) *popup_hide()*
343344
exists but is not a popup window an error is given. *E993*
344345

345346

347+
popup_locate({row}, {col}) *popup_locate()*
348+
Return the |window-ID| of the popup at screen positoin {row}
349+
and {col}. If there are multiple popups the one with the
350+
highest zindex is returned. If there are no popups at this
351+
position then zero is returned.
352+
353+
346354
popup_menu({what}, {options}) *popup_menu()*
347355
Show the {what} near the cursor, handle selecting one of the
348356
items with cursorkeys, and close it an item is selected with

runtime/doc/tags

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8364,6 +8364,8 @@ popup-window popup.txt /*popup-window*
83648364
popup-window-functions usr_41.txt /*popup-window-functions*
83658365
popup.txt popup.txt /*popup.txt*
83668366
popup_atcursor() popup.txt /*popup_atcursor()*
8367+
popup_beval() popup.txt /*popup_beval()*
8368+
popup_beval_example popup.txt /*popup_beval_example*
83678369
popup_clear() popup.txt /*popup_clear()*
83688370
popup_close() popup.txt /*popup_close()*
83698371
popup_create() popup.txt /*popup_create()*
@@ -8375,6 +8377,7 @@ popup_filter_yesno() popup.txt /*popup_filter_yesno()*
83758377
popup_getoptions() popup.txt /*popup_getoptions()*
83768378
popup_getpos() popup.txt /*popup_getpos()*
83778379
popup_hide() popup.txt /*popup_hide()*
8380+
popup_locate() popup.txt /*popup_locate()*
83788381
popup_menu() popup.txt /*popup_menu()*
83798382
popup_menu-shortcut-example popup.txt /*popup_menu-shortcut-example*
83808383
popup_move() popup.txt /*popup_move()*
@@ -8713,6 +8716,7 @@ screenattr() eval.txt /*screenattr()*
87138716
screenchar() eval.txt /*screenchar()*
87148717
screenchars() eval.txt /*screenchars()*
87158718
screencol() eval.txt /*screencol()*
8719+
screenpos() eval.txt /*screenpos()*
87168720
screenrow() eval.txt /*screenrow()*
87178721
screenstring() eval.txt /*screenstring()*
87188722
script usr_41.txt /*script*

src/Make_cyg_ming.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ install.exe: dosinst.c
10061006
$(CC) $(CFLAGS) -o install.exe dosinst.c $(LIB) -lole32 -luuid
10071007

10081008
uninstal.exe: uninstal.c
1009-
$(CC) $(CFLAGS) -o uninstal.exe uninstal.c $(LIB)
1009+
$(CC) $(CFLAGS) -o uninstal.exe uninstal.c $(LIB) -lole32
10101010

10111011
ifeq ($(VIMDLL),yes)
10121012
$(TARGET): $(OUTDIR) $(OBJ)

src/blob.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ blob_copy(typval_T *from, typval_T *to)
6363
int ret = OK;
6464

6565
to->v_type = VAR_BLOB;
66+
to->v_lock = 0;
6667
if (from->vval.v_blob == NULL)
6768
to->vval.v_blob = NULL;
6869
else if (rettv_blob_alloc(to) == FAIL)

src/change.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,15 +325,17 @@ f_listener_flush(typval_T *argvars, typval_T *rettv UNUSED)
325325
* listener_remove() function
326326
*/
327327
void
328-
f_listener_remove(typval_T *argvars, typval_T *rettv UNUSED)
328+
f_listener_remove(typval_T *argvars, typval_T *rettv)
329329
{
330330
listener_T *lnr;
331331
listener_T *next;
332-
listener_T *prev = NULL;
332+
listener_T *prev;
333333
int id = tv_get_number(argvars);
334334
buf_T *buf;
335335

336336
for (buf = firstbuf; buf != NULL; buf = buf->b_next)
337+
{
338+
prev = NULL;
337339
for (lnr = buf->b_listener; lnr != NULL; lnr = next)
338340
{
339341
next = lnr->lr_next;
@@ -345,9 +347,12 @@ f_listener_remove(typval_T *argvars, typval_T *rettv UNUSED)
345347
buf->b_listener = lnr->lr_next;
346348
free_callback(&lnr->lr_callback);
347349
vim_free(lnr);
350+
rettv->vval.v_number = 1;
351+
return;
348352
}
349353
prev = lnr;
350354
}
355+
}
351356
}
352357

353358
/*

src/create_cmdidxs.vim

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ let lines = readfile('ex_cmds.h')
1414
let idx = 0
1515
while idx < len(lines)
1616
let line = lines[idx]
17-
if line =~ '^EX(CMD_'
18-
let m = matchlist(line, '^EX(CMD_\S*,\s*"\([a-z][^"]*\)"')
17+
if line =~ '^EXCMD(CMD_'
18+
let m = matchlist(line, '^EXCMD(CMD_\S*,\s*"\([a-z][^"]*\)"')
1919
if len(m) >= 2
2020
let cmds += [ m[1] ]
2121
else
@@ -27,18 +27,18 @@ while idx < len(lines)
2727
let idx += 1
2828
let addr_type = lines[idx]
2929

30-
if flags =~ '\<RANGE\>'
30+
if flags =~ '\<EX_RANGE\>'
3131
if addr_type =~ 'ADDR_NONE'
32-
echoerr 'ex_cmds.h:' .. (idx - 1) .. ': Using RANGE with ADDR_NONE: ' .. line
32+
echoerr 'ex_cmds.h:' .. (idx - 1) .. ': Using EX_RANGE with ADDR_NONE: ' .. line
3333
endif
3434
else
3535
if addr_type !~ 'ADDR_NONE'
36-
echoerr 'ex_cmds.h:' .. (idx - 1) .. ': Missing ADDR_NONE: ' .. line
36+
echoerr 'ex_cmds.h:' .. (idx - 1) .. ': Missing ADDR_NONE: ' .. line
3737
endif
3838
endif
3939

40-
if flags =~ '\<DFLALL\>' && (addr_type =~ 'ADDR_OTHER' || addr_type =~ 'ADDR_NONE')
41-
echoerr 'ex_cmds.h:' .. (idx - 1) .. ': Missing misplaced DFLALL: ' .. line
40+
if flags =~ '\<EX_DFLALL\>' && (addr_type =~ 'ADDR_OTHER' || addr_type =~ 'ADDR_NONE')
41+
echoerr 'ex_cmds.h:' .. (idx - 1) .. ': Missing misplaced EX_DFLALL: ' .. line
4242
endif
4343
endif
4444
let idx += 1

src/evalfunc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,7 @@ static struct fst
781781
{"popup_getoptions", 1, 1, f_popup_getoptions},
782782
{"popup_getpos", 1, 1, f_popup_getpos},
783783
{"popup_hide", 1, 1, f_popup_hide},
784+
{"popup_locate", 2, 2, f_popup_locate},
784785
{"popup_menu", 2, 2, f_popup_menu},
785786
{"popup_move", 2, 2, f_popup_move},
786787
{"popup_notification", 2, 2, f_popup_notification},
@@ -3547,7 +3548,7 @@ f_expandcmd(typval_T *argvars, typval_T *rettv)
35473548
memset(&eap, 0, sizeof(eap));
35483549
eap.cmd = cmdstr;
35493550
eap.arg = cmdstr;
3550-
eap.argt |= NOSPC;
3551+
eap.argt |= EX_NOSPC;
35513552
eap.usefilter = FALSE;
35523553
eap.nextcmd = NULL;
35533554
eap.cmdidx = CMD_USER;

0 commit comments

Comments
 (0)