Compare commits

...

16 Commits

Author SHA1 Message Date
Bram Moolenaar
eaa49e40d7 patch 8.1.1679: test using SwapExists autocommand file may fail
Problem:    Test using SwapExists autocommand file may fail.
Solution:   Remove the SwapExists autocommand.
2019-07-13 18:08:59 +02:00
Bram Moolenaar
a901a37bae patch 8.1.1678: using popup_menu() does not scroll to show the selected line
Problem:    When using popup_menu() does not scroll to show the selected line.
Solution:   Scroll the text. (Naruhiko Nishino, closes #4651)
2019-07-13 16:38:50 +02:00
Bram Moolenaar
b073da8929 patch 8.1.1677: tests get stuck when running into an existing swapfile
Problem:    Tests get stuck when running into an existing swapfile.
Solution:   Set v:swapchoice to "q" and report an error. (Daniel Hahler,
            closes #4644)
2019-07-13 14:47:26 +02:00
Bram Moolenaar
017c269938 patch 8.1.1676: "maxwidth" of popup window does not always work properly
Problem:    "maxwidth" of popup window does not always work properly.
Solution:   Adjust the computation. (Naruhiko Nishino, closes #4653)
2019-07-13 14:17:51 +02:00
Bram Moolenaar
7b73f914c4 patch 8.1.1675: listener list not correctly updated on listener_remove()
Problem:    Listener list not correctly updated on listener_remove().
Solution:   Only set "prev" when not removing a listener.  Return one if the
            listener was found and removed.
2019-07-13 13:03:02 +02:00
Bram Moolenaar
4e63f9425e patch 8.1.1674: script to check a colorscheme can be improved
Problem:    Script to check a colorscheme can be improved.
Solution:   Match the whole group name. Don't warn for what is usually omitted.
2019-07-12 22:46:47 +02:00
Bram Moolenaar
b4f0628fc5 patch 8.1.1673: cannot easily find the popup window at a certain position
Problem:    Cannot easily find the popup window at a certain position.
Solution:   Add popup_locate().
2019-07-12 21:07:54 +02:00
Bram Moolenaar
d94ac0caca patch 8.1.1672: "make cmdidxs" doesn't work
Problem:    "make cmdidxs" doesn't work.
Solution:   Update macro names. (Naruhiko Nishino, closes #4660)
2019-07-12 20:24:59 +02:00
Bram Moolenaar
b7b9efbccf patch 8.1.1671: copying a blob may result in it being locked
Problem:    Copying a blob may result in it being locked.
Solution:   Reset v_lock. (Ken Takata, closes #4648)
2019-07-12 20:17:03 +02:00
Bram Moolenaar
0231f8312b patch 8.1.1670: sign column not always properly aligned
Problem:    Sign column not always properly aligned.
Solution:   Use "col" only after it was calculated. (Yee Cheng Chin,
            closes #4649)
2019-07-12 19:22:22 +02:00
Bram Moolenaar
efef9fea72 patch 8.1.1669: Travis: test results section is closed even when failed
Problem:    Travis: test results section is closed even when some tests
            failed.
Solution:   Only close the section on success. (Daniel Hahler, closes #4659)
2019-07-12 18:45:40 +02:00
Bram Moolenaar
8ccabf624e patch 8.1.1668: popup window test is a bit flaky on some systems
Problem:    Popup window test is a bit flaky on some systems.
Solution:   Clear the command line. (Naruhiko Nishino, closes #4656)
2019-07-12 18:12:51 +02:00
Bram Moolenaar
8071cb2c64 patch 8.1.1667: flags for Ex commands may clash with other symbols
Problem:    Flags for Ex commands may clash with other symbols.
Solution:   Prepend with EX_.
2019-07-12 17:58:01 +02:00
Bram Moolenaar
bd42b31780 patch 8.1.1666: click in popup window scrollbar with border doesn't scroll
Problem:    Click in popup window scrollbar with border doesn't scroll.
Solution:   Correct column for the border. (Naruhiko Nishino, closes #4650)
2019-07-12 16:35:34 +02:00
Bram Moolenaar
b420747478 patch 8.1.1665: crash when popup window with mask is below the screen
Problem:    Crash when popup window with mask is below the screen.
Solution:   Correct boundary check.
2019-07-12 16:05:45 +02:00
Bram Moolenaar
847a5d69a8 patch 8.1.1664: GUI resize may cause changing Rows at a bad time
Problem:    GUI resize may cause changing Rows at a bad time. (Dominique
            Pelle)
Solution:   Postpone resizing while updating the screen.
2019-07-12 15:37:13 +02:00
30 changed files with 1568 additions and 1285 deletions

View File

@@ -142,8 +142,11 @@ script:
"${SRCDIR}"/vim --not-a-term -u NONE -S "${SRCDIR}"/testdir/if_ver-2.vim -c quit > /dev/null
cat if_ver.txt
fi
- do_test make ${SHADOWOPT} ${TEST}
- echo -en "travis_fold:end:test\\r\\033[0K"
- |
if do_test make ${SHADOWOPT} ${TEST}; then
echo -en "travis_fold:end:test\\r\\033[0K"
fi
# instead of a 2*2*8 matrix (2*os + 2*compiler + 8*env),
# exclude some builds on mac os x and linux

View File

@@ -8,7 +8,7 @@ set cpo&vim
func! Test_check_colors()
let l:savedview = winsaveview()
call cursor(1,1)
let err={}
let err = {}
" 1) Check g:colors_name is existing
if !search('\<\%(g:\)\?colors_name\>', 'cnW')
@@ -81,36 +81,39 @@ func! Test_check_colors()
\ 'WarningMsg',
\ 'WildMenu',
\ ]
let groups={}
let groups = {}
for group in hi_groups
if search('\c@suppress\s\+'.group, 'cnW')
if search('\c@suppress\s\+\<' .. group .. '\>', 'cnW')
" skip check, if the script contains a line like
" @suppress Visual:
let groups[group] = 'Ignoring '.group
continue
endif
if search('hi\%[ghlight]!\= \+link \+'.group, 'cnW') " Linked group
if search('hi\%[ghlight]!\= \+link \+' .. group, 'cnW') " Linked group
continue
endif
if !search('hi\%[ghlight] \+'.group, 'cnW')
let groups[group] = 'No highlight definition for '.group
if !search('hi\%[ghlight] \+\<' .. group .. '\>', 'cnW')
let groups[group] = 'No highlight definition for ' .. group
continue
endif
if !search('hi\%[ghlight] \+'.group. '.*fg=', 'cnW')
let groups[group] = 'Missing foreground color for '.group
if !search('hi\%[ghlight] \+\<' .. group .. '\>.*[bf]g=', 'cnW')
let groups[group] = 'Missing foreground or background color for ' .. group
continue
endif
if search('hi\%[ghlight] \+'.group. '.*guibg=', 'cnW') &&
\ !search('hi\%[ghlight] \+'.group. '.*ctermbg=', 'cnW')
let groups[group] = 'Missing bg terminal color for '.group
if search('hi\%[ghlight] \+\<' .. group .. '\>.*guibg=', 'cnW') &&
\ !search('hi\%[ghlight] \+\<' .. group .. '\>.*ctermbg=', 'cnW')
\ && group != 'Cursor'
let groups[group] = 'Missing bg terminal color for ' .. group
continue
endif
if !search('hi\%[ghlight] \+'.group. '.*guifg=', 'cnW')
let groups[group] = 'Missing guifg definition for '.group
if !search('hi\%[ghlight] \+\<' .. group .. '\>.*guifg=', 'cnW')
\ && group !~ '^Diff'
let groups[group] = 'Missing guifg definition for ' .. group
continue
endif
if !search('hi\%[ghlight] \+'.group. '.*ctermfg=', 'cnW')
let groups[group] = 'Missing ctermfg definition for '.group
if !search('hi\%[ghlight] \+\<' .. group .. '\>.*ctermfg=', 'cnW')
\ && group !~ '^Diff'
\ && group != 'Cursor'
let groups[group] = 'Missing ctermfg definition for ' .. group
continue
endif
" do not check for background colors, they could be intentionally left out
@@ -120,10 +123,10 @@ func! Test_check_colors()
" 3) Check, that it does not set background highlighting
" Doesn't ':hi Normal ctermfg=253 ctermfg=233' also set the background sometimes?
let bg_set='\(set\?\|setl\(ocal\)\?\) .*\(background\|bg\)=\(dark\|light\)'
let bg_let='let \%([&]\%([lg]:\)\?\)\%(background\|bg\)\s*=\s*\([''"]\?\)\w\+\1'
let bg_pat='\%('.bg_set. '\|'.bg_let.'\)'
let line=search(bg_pat, 'cnW')
let bg_set = '\(set\?\|setl\(ocal\)\?\) .*\(background\|bg\)=\(dark\|light\)'
let bg_let = 'let \%([&]\%([lg]:\)\?\)\%(background\|bg\)\s*=\s*\([''"]\?\)\w\+\1'
let bg_pat = '\%(' .. bg_set .. '\|' .. bg_let .. '\)'
let line = search(bg_pat, 'cnW')
if search(bg_pat, 'cnW')
exe line
if search('hi \U\w\+\s\+\S', 'cbnW')
@@ -145,7 +148,7 @@ func! Test_check_colors()
" if exists("syntax_on")
" syntax reset
" endif
let pat='hi\%[ghlight]\s*clear\n\s*if\s*exists(\([''"]\)syntax_on\1)\n\s*syn\%[tax]\s*reset\n\s*endif'
let pat = 'hi\%[ghlight]\s*clear\n\s*if\s*exists(\([''"]\)syntax_on\1)\n\s*syn\%[tax]\s*reset\n\s*endif'
if !search(pat, 'cnW')
let err['init'] = 'No initialization'
endif
@@ -160,7 +163,7 @@ func! Test_check_colors()
let ft_groups = []
" let group = '\%('.join(hi_groups, '\|').'\)' " More efficient than a for loop, but less informative
for group in hi_groups
let pat='\Chi\%[ghlight]!\= *\%[link] \+\zs'.group.'\w\+\>\ze \+.' " Skips `hi clear`
let pat = '\Chi\%[ghlight]!\= *\%[link] \+\zs' .. group .. '\w\+\>\ze \+.' " Skips `hi clear`
if search(pat, 'cW')
call add(ft_groups, matchstr(getline('.'), pat))
endif
@@ -172,7 +175,7 @@ func! Test_check_colors()
" 8) Were debugPC and debugBreakpoint defined?
for group in ['debugPC', 'debugBreakpoint']
let pat='\Chi\%[ghlight]!\= *\%[link] \+\zs'.group.'\>'
let pat = '\Chi\%[ghlight]!\= *\%[link] \+\zs' .. group .. '\>'
if search(pat, 'cnW')
let line = search(pat, 'cW')
let err['filetype'] = get(err, 'filetype', 'Should not define: ') . matchstr(getline('.'), pat). ' '

View File

@@ -170,6 +170,7 @@ Filter functions:
Other:
|popup_getoptions()| get current options for a popup
|popup_getpos()| get actual position and size of a popup
|popup_locate()| find popup window at a screen position
DETAILS *popup-function-details*
@@ -343,6 +344,13 @@ popup_hide({id}) *popup_hide()*
exists but is not a popup window an error is given. *E993*
popup_locate({row}, {col}) *popup_locate()*
Return the |window-ID| of the popup at screen positoin {row}
and {col}. If there are multiple popups the one with the
highest zindex is returned. If there are no popups at this
position then zero is returned.
popup_menu({what}, {options}) *popup_menu()*
Show the {what} near the cursor, handle selecting one of the
items with cursorkeys, and close it an item is selected with

View File

@@ -63,6 +63,7 @@ blob_copy(typval_T *from, typval_T *to)
int ret = OK;
to->v_type = VAR_BLOB;
to->v_lock = 0;
if (from->vval.v_blob == NULL)
to->vval.v_blob = NULL;
else if (rettv_blob_alloc(to) == FAIL)

View File

@@ -325,15 +325,17 @@ f_listener_flush(typval_T *argvars, typval_T *rettv UNUSED)
* listener_remove() function
*/
void
f_listener_remove(typval_T *argvars, typval_T *rettv UNUSED)
f_listener_remove(typval_T *argvars, typval_T *rettv)
{
listener_T *lnr;
listener_T *next;
listener_T *prev = NULL;
listener_T *prev;
int id = tv_get_number(argvars);
buf_T *buf;
for (buf = firstbuf; buf != NULL; buf = buf->b_next)
{
prev = NULL;
for (lnr = buf->b_listener; lnr != NULL; lnr = next)
{
next = lnr->lr_next;
@@ -345,9 +347,12 @@ f_listener_remove(typval_T *argvars, typval_T *rettv UNUSED)
buf->b_listener = lnr->lr_next;
free_callback(&lnr->lr_callback);
vim_free(lnr);
rettv->vval.v_number = 1;
return;
}
prev = lnr;
}
}
}
/*

View File

@@ -14,8 +14,8 @@ let lines = readfile('ex_cmds.h')
let idx = 0
while idx < len(lines)
let line = lines[idx]
if line =~ '^EX(CMD_'
let m = matchlist(line, '^EX(CMD_\S*,\s*"\([a-z][^"]*\)"')
if line =~ '^EXCMD(CMD_'
let m = matchlist(line, '^EXCMD(CMD_\S*,\s*"\([a-z][^"]*\)"')
if len(m) >= 2
let cmds += [ m[1] ]
else
@@ -27,18 +27,18 @@ while idx < len(lines)
let idx += 1
let addr_type = lines[idx]
if flags =~ '\<RANGE\>'
if flags =~ '\<EX_RANGE\>'
if addr_type =~ 'ADDR_NONE'
echoerr 'ex_cmds.h:' .. (idx - 1) .. ': Using RANGE with ADDR_NONE: ' .. line
echoerr 'ex_cmds.h:' .. (idx - 1) .. ': Using EX_RANGE with ADDR_NONE: ' .. line
endif
else
if addr_type !~ 'ADDR_NONE'
echoerr 'ex_cmds.h:' .. (idx - 1) .. ': Missing ADDR_NONE: ' .. line
echoerr 'ex_cmds.h:' .. (idx - 1) .. ': Missing ADDR_NONE: ' .. line
endif
endif
if flags =~ '\<DFLALL\>' && (addr_type =~ 'ADDR_OTHER' || addr_type =~ 'ADDR_NONE')
echoerr 'ex_cmds.h:' .. (idx - 1) .. ': Missing misplaced DFLALL: ' .. line
if flags =~ '\<EX_DFLALL\>' && (addr_type =~ 'ADDR_OTHER' || addr_type =~ 'ADDR_NONE')
echoerr 'ex_cmds.h:' .. (idx - 1) .. ': Missing misplaced EX_DFLALL: ' .. line
endif
endif
let idx += 1

View File

@@ -781,6 +781,7 @@ static struct fst
{"popup_getoptions", 1, 1, f_popup_getoptions},
{"popup_getpos", 1, 1, f_popup_getpos},
{"popup_hide", 1, 1, f_popup_hide},
{"popup_locate", 2, 2, f_popup_locate},
{"popup_menu", 2, 2, f_popup_menu},
{"popup_move", 2, 2, f_popup_move},
{"popup_notification", 2, 2, f_popup_notification},
@@ -3547,7 +3548,7 @@ f_expandcmd(typval_T *argvars, typval_T *rettv)
memset(&eap, 0, sizeof(eap));
eap.cmd = cmdstr;
eap.arg = cmdstr;
eap.argt |= NOSPC;
eap.argt |= EX_NOSPC;
eap.usefilter = FALSE;
eap.nextcmd = NULL;
eap.cmdidx = CMD_USER;

File diff suppressed because it is too large Load Diff

View File

@@ -1844,7 +1844,7 @@ do_one_cmd(
if (*ea.cmd == '|' || (exmode_active && ea.line1 != ea.line2))
{
ea.cmdidx = CMD_print;
ea.argt = RANGE+COUNT+TRLBAR;
ea.argt = EX_RANGE+EX_COUNT+EX_TRLBAR;
if ((errormsg = invalid_range(&ea)) == NULL)
{
correct_range(&ea);
@@ -1976,26 +1976,26 @@ do_one_cmd(
if (!ea.skip)
{
#ifdef HAVE_SANDBOX
if (sandbox != 0 && !(ea.argt & SBOXOK))
if (sandbox != 0 && !(ea.argt & EX_SBOXOK))
{
// Command not allowed in sandbox.
errormsg = _(e_sandbox);
goto doend;
}
#endif
if (restricted != 0 && (ea.argt & RESTRICT))
if (restricted != 0 && (ea.argt & EX_RESTRICT))
{
errormsg = _("E981: Command not allowed in rvim");
goto doend;
}
if (!curbuf->b_p_ma && (ea.argt & MODIFY))
if (!curbuf->b_p_ma && (ea.argt & EX_MODIFY))
{
/* Command not allowed in non-'modifiable' buffer */
errormsg = _(e_modifiable);
goto doend;
}
if (text_locked() && !(ea.argt & CMDWIN)
if (text_locked() && !(ea.argt & EX_CMDWIN)
&& !IS_USER_CMDIDX(ea.cmdidx))
{
/* Command not allowed when editing the command line. */
@@ -2007,7 +2007,7 @@ do_one_cmd(
* Do allow ":checktime" (it is postponed).
* Do allow ":edit" (check for an argument later).
* Do allow ":file" with no arguments (check for an argument later). */
if (!(ea.argt & CMDWIN)
if (!(ea.argt & EX_CMDWIN)
&& ea.cmdidx != CMD_checktime
&& ea.cmdidx != CMD_edit
&& ea.cmdidx != CMD_file
@@ -2015,7 +2015,7 @@ do_one_cmd(
&& curbuf_locked())
goto doend;
if (!ni && !(ea.argt & RANGE) && ea.addr_count > 0)
if (!ni && !(ea.argt & EX_RANGE) && ea.addr_count > 0)
{
/* no range allowed */
errormsg = _(e_norange);
@@ -2023,7 +2023,7 @@ do_one_cmd(
}
}
if (!ni && !(ea.argt & BANG) && ea.forceit) /* no <!> allowed */
if (!ni && !(ea.argt & EX_BANG) && ea.forceit) // no <!> allowed
{
errormsg = _(e_nobang);
goto doend;
@@ -2033,7 +2033,7 @@ do_one_cmd(
* Don't complain about the range if it is not used
* (could happen if line_count is accidentally set to 0).
*/
if (!ea.skip && !ni && (ea.argt & RANGE))
if (!ea.skip && !ni && (ea.argt & EX_RANGE))
{
/*
* If the range is backwards, ask for confirmation and, if given, swap
@@ -2068,7 +2068,7 @@ do_one_cmd(
correct_range(&ea);
#ifdef FEAT_FOLDING
if (((ea.argt & WHOLEFOLD) || ea.addr_count >= 2) && !global_busy
if (((ea.argt & EX_WHOLEFOLD) || ea.addr_count >= 2) && !global_busy
&& ea.addr_type == ADDR_LINES)
{
/* Put the first line at the start of a closed fold, put the last line
@@ -2105,7 +2105,7 @@ do_one_cmd(
* Check for "++opt=val" argument.
* Must be first, allow ":w ++enc=utf8 !cmd"
*/
if (ea.argt & ARGOPT)
if (ea.argt & EX_ARGOPT)
while (ea.arg[0] == '+' && ea.arg[1] == '+')
if (getargopt(&ea) == FAIL && !ni)
{
@@ -2161,14 +2161,14 @@ do_one_cmd(
* Check for "+command" argument, before checking for next command.
* Don't do this for ":read !cmd" and ":write !cmd".
*/
if ((ea.argt & EDITCMD) && !ea.usefilter)
if ((ea.argt & EX_CMDARG) && !ea.usefilter)
ea.do_ecmd_cmd = getargcmd(&ea.arg);
/*
* Check for '|' to separate commands and '"' to start comments.
* Don't do this for ":read !cmd" and ":write !cmd".
*/
if ((ea.argt & TRLBAR) && !ea.usefilter)
if ((ea.argt & EX_TRLBAR) && !ea.usefilter)
separate_nextcmd(&ea);
/*
@@ -2201,7 +2201,7 @@ do_one_cmd(
}
}
if ((ea.argt & DFLALL) && ea.addr_count == 0)
if ((ea.argt & EX_DFLALL) && ea.addr_count == 0)
{
buf_T *buf;
@@ -2251,17 +2251,17 @@ do_one_cmd(
case ADDR_NONE:
case ADDR_UNSIGNED:
case ADDR_QUICKFIX:
iemsg(_("INTERNAL: Cannot use DFLALL with ADDR_NONE, ADDR_UNSIGNED or ADDR_QUICKFIX"));
iemsg(_("INTERNAL: Cannot use EX_DFLALL with ADDR_NONE, ADDR_UNSIGNED or ADDR_QUICKFIX"));
break;
}
}
/* accept numbered register only when no count allowed (:put) */
if ( (ea.argt & REGSTR)
if ( (ea.argt & EX_REGSTR)
&& *ea.arg != NUL
/* Do not allow register = for user commands */
&& (!IS_USER_CMDIDX(ea.cmdidx) || *ea.arg != '=')
&& !((ea.argt & COUNT) && VIM_ISDIGIT(*ea.arg)))
&& !((ea.argt & EX_COUNT) && VIM_ISDIGIT(*ea.arg)))
{
#ifndef FEAT_CLIPBOARD
/* check these explicitly for a more specific error message */
@@ -2288,16 +2288,16 @@ do_one_cmd(
}
/*
* Check for a count. When accepting a BUFNAME, don't use "123foo" as a
* Check for a count. When accepting a EX_BUFNAME, don't use "123foo" as a
* count, it's a buffer name.
*/
if ((ea.argt & COUNT) && VIM_ISDIGIT(*ea.arg)
&& (!(ea.argt & BUFNAME) || *(p = skipdigits(ea.arg)) == NUL
if ((ea.argt & EX_COUNT) && VIM_ISDIGIT(*ea.arg)
&& (!(ea.argt & EX_BUFNAME) || *(p = skipdigits(ea.arg)) == NUL
|| VIM_ISWHITE(*p)))
{
n = getdigits(&ea.arg);
ea.arg = skipwhite(ea.arg);
if (n <= 0 && !ni && (ea.argt & ZEROR) == 0)
if (n <= 0 && !ni && (ea.argt & EX_ZEROR) == 0)
{
errormsg = _(e_zerocount);
goto doend;
@@ -2324,17 +2324,17 @@ do_one_cmd(
/*
* Check for flags: 'l', 'p' and '#'.
*/
if (ea.argt & EXFLAGS)
if (ea.argt & EX_FLAGS)
get_flags(&ea);
/* no arguments allowed */
if (!ni && !(ea.argt & EXTRA) && *ea.arg != NUL
&& *ea.arg != '"' && (*ea.arg != '|' || (ea.argt & TRLBAR) == 0))
if (!ni && !(ea.argt & EX_EXTRA) && *ea.arg != NUL
&& *ea.arg != '"' && (*ea.arg != '|' || (ea.argt & EX_TRLBAR) == 0))
{
// no arguments allowed but there is something
errormsg = _(e_trailing);
goto doend;
}
if (!ni && (ea.argt & NEEDARG) && *ea.arg == NUL)
if (!ni && (ea.argt & EX_NEEDARG) && *ea.arg == NUL)
{
errormsg = _(e_argreq);
goto doend;
@@ -2368,7 +2368,7 @@ do_one_cmd(
break;
/* Commands that handle '|' themselves. Check: A command should
* either have the TRLBAR flag, appear in this list or appear in
* either have the EX_TRLBAR flag, appear in this list or appear in
* the list at ":help :bar". */
case CMD_aboveleft:
case CMD_and:
@@ -2435,7 +2435,7 @@ do_one_cmd(
}
#endif
if (ea.argt & XFILE)
if (ea.argt & EX_XFILE)
{
if (expand_filename(&ea, cmdlinep, &errormsg) == FAIL)
goto doend;
@@ -2445,7 +2445,7 @@ do_one_cmd(
* Accept buffer name. Cannot be used at the same time with a buffer
* number. Don't do this for a user command.
*/
if ((ea.argt & BUFNAME) && *ea.arg != NUL && ea.addr_count == 0
if ((ea.argt & EX_BUFNAME) && *ea.arg != NUL && ea.addr_count == 0
&& !IS_USER_CMDIDX(ea.cmdidx))
{
/*
@@ -2462,7 +2462,7 @@ do_one_cmd(
while (p > ea.arg && VIM_ISWHITE(p[-1]))
--p;
}
ea.line2 = buflist_findpat(ea.arg, p, (ea.argt & BUFUNL) != 0,
ea.line2 = buflist_findpat(ea.arg, p, (ea.argt & EX_BUFUNL) != 0,
FALSE, FALSE);
if (ea.line2 < 0) /* failed */
goto doend;
@@ -3528,7 +3528,7 @@ set_one_cmd_context(
}
/* Does command allow "+command"? */
if ((ea.argt & EDITCMD) && !usefilter && *arg == '+')
if ((ea.argt & EX_CMDARG) && !usefilter && *arg == '+')
{
/* Check if we're in the +command */
p = arg + 1;
@@ -3546,7 +3546,7 @@ set_one_cmd_context(
* Check for '|' to separate commands and '"' to start comments.
* Don't do this for ":read !cmd" and ":write !cmd".
*/
if ((ea.argt & TRLBAR) && !usefilter)
if ((ea.argt & EX_TRLBAR) && !usefilter)
{
p = arg;
/* ":redir @" is not the start of a comment */
@@ -3559,7 +3559,7 @@ set_one_cmd_context(
if (p[1] != NUL)
++p;
}
else if ( (*p == '"' && !(ea.argt & NOTRLCOM))
else if ( (*p == '"' && !(ea.argt & EX_NOTRLCOM))
|| *p == '|' || *p == '\n')
{
if (*(p - 1) != '\\')
@@ -3573,9 +3573,9 @@ set_one_cmd_context(
}
}
/* no arguments allowed */
if (!(ea.argt & EXTRA) && *arg != NUL &&
vim_strchr((char_u *)"|\"", *arg) == NULL)
if (!(ea.argt & EX_EXTRA) && *arg != NUL
&& vim_strchr((char_u *)"|\"", *arg) == NULL)
// no arguments allowed but there is something
return NULL;
/* Find start of last argument (argument just before cursor): */
@@ -3597,7 +3597,7 @@ set_one_cmd_context(
}
}
if (ea.argt & XFILE)
if (ea.argt & EX_XFILE)
{
int c;
int in_quote = FALSE;
@@ -3630,7 +3630,7 @@ set_one_cmd_context(
* characters that end the command and white space. */
else if (c == '|' || c == '\n' || c == '"' || (VIM_ISWHITE(c)
#ifdef SPACE_IN_FILENAME
&& (!(ea.argt & NOSPC) || usefilter)
&& (!(ea.argt & EX_NOSPC) || usefilter)
#endif
))
{
@@ -4001,8 +4001,8 @@ set_one_cmd_context(
case CMD_USER_BUF:
if (compl != EXPAND_NOTHING)
{
// XFILE: file names are handled above
if (!(ea.argt & XFILE))
// EX_XFILE: file names are handled above
if (!(ea.argt & EX_XFILE))
{
#ifdef FEAT_MENU
if (compl == EXPAND_MENUS)
@@ -4652,7 +4652,7 @@ invalid_range(exarg_T *eap)
|| eap->line1 > eap->line2)
return _(e_invrange);
if (eap->argt & RANGE)
if (eap->argt & EX_RANGE)
{
switch (eap->addr_type)
{
@@ -4738,7 +4738,7 @@ invalid_range(exarg_T *eap)
static void
correct_range(exarg_T *eap)
{
if (!(eap->argt & ZEROR)) /* zero in range not allowed */
if (!(eap->argt & EX_ZEROR)) // zero in range not allowed
{
if (eap->line1 == 0)
eap->line1 = 1;
@@ -4947,7 +4947,7 @@ expand_filename(
&& eap->cmdidx != CMD_make
&& eap->cmdidx != CMD_terminal
#ifndef UNIX
&& !(eap->argt & NOSPC)
&& !(eap->argt & EX_NOSPC)
#endif
)
{
@@ -4999,7 +4999,7 @@ expand_filename(
* One file argument: Expand wildcards.
* Don't do this with ":r !command" or ":w !command".
*/
if ((eap->argt & NOSPC) && !eap->usefilter)
if ((eap->argt & EX_NOSPC) && !eap->usefilter)
{
/*
* May do this twice:
@@ -5150,7 +5150,7 @@ separate_nextcmd(exarg_T *eap)
{
if (*p == Ctrl_V)
{
if (eap->argt & (USECTRLV | XFILE))
if (eap->argt & (EX_CTRLV | EX_XFILE))
++p; /* skip CTRL-V and next char */
else
/* remove CTRL-V and skip next char */
@@ -5161,7 +5161,7 @@ separate_nextcmd(exarg_T *eap)
#ifdef FEAT_EVAL
/* Skip over `=expr` when wildcards are expanded. */
else if (p[0] == '`' && p[1] == '=' && (eap->argt & XFILE))
else if (p[0] == '`' && p[1] == '=' && (eap->argt & EX_XFILE))
{
p += 2;
(void)skip_expr(&p);
@@ -5171,7 +5171,7 @@ separate_nextcmd(exarg_T *eap)
/* Check for '"': start of comment or '|': next command */
/* :@" and :*" do not start a comment!
* :redir @" doesn't either. */
else if ((*p == '"' && !(eap->argt & NOTRLCOM)
else if ((*p == '"' && !(eap->argt & EX_NOTRLCOM)
&& ((eap->cmdidx != CMD_at && eap->cmdidx != CMD_star)
|| p != eap->arg)
&& (eap->cmdidx != CMD_redir
@@ -5179,11 +5179,11 @@ separate_nextcmd(exarg_T *eap)
|| *p == '|' || *p == '\n')
{
/*
* We remove the '\' before the '|', unless USECTRLV is used
* We remove the '\' before the '|', unless EX_CTRLV is used
* AND 'b' is present in 'cpoptions'.
*/
if ((vim_strchr(p_cpo, CPO_BAR) == NULL
|| !(eap->argt & USECTRLV)) && *(p - 1) == '\\')
|| !(eap->argt & EX_CTRLV)) && *(p - 1) == '\\')
{
STRMOVE(p - 1, p); /* remove the '\' */
--p;
@@ -5197,7 +5197,7 @@ separate_nextcmd(exarg_T *eap)
}
}
if (!(eap->argt & NOTRLCOM)) /* remove trailing spaces */
if (!(eap->argt & EX_NOTRLCOM)) /* remove trailing spaces */
del_trailing_spaces(eap->arg);
}
@@ -9276,6 +9276,7 @@ find_cmdline_var(char_u *src, int *usedlen)
* '#' to curwin->w_altfile
* '<cword>' to word under the cursor
* '<cWORD>' to WORD under the cursor
* '<cexpr>' to C-expression under the cursor
* '<cfile>' to path name under the cursor
* '<sfile>' to sourced file name
* '<slnum>' to sourced file line number

View File

@@ -4834,7 +4834,7 @@ addstar(
* EXPAND_COMMANDS Cursor is still touching the command, so complete
* it.
* EXPAND_BUFFERS Complete file names for :buf and :sbuf commands.
* EXPAND_FILES After command with XFILE set, or after setting
* EXPAND_FILES After command with EX_XFILE set, or after setting
* with P_EXPAND set. eg :e ^I, :w>>^I
* EXPAND_DIRECTORIES In some cases this is used instead of the latter
* when we know only directories are of interest. eg

View File

@@ -2253,7 +2253,7 @@ gui_outstr_nowrap(
int col = gui.col;
#ifdef FEAT_SIGN_ICONS
int draw_sign = FALSE;
int signcol = col;
int signcol;
char_u extra[18];
# ifdef FEAT_NETBEANS_INTG
int multi_sign = FALSE;
@@ -2270,7 +2270,7 @@ gui_outstr_nowrap(
# ifdef FEAT_NETBEANS_INTG
|| *s == MULTISIGN_BYTE
# endif
)
)
{
# ifdef FEAT_NETBEANS_INTG
if (*s == MULTISIGN_BYTE)
@@ -2289,7 +2289,10 @@ gui_outstr_nowrap(
--col;
len = (int)STRLEN(s);
if (len > 2)
signcol = col + len - 3; // Right align sign icon in the number column
// right align sign icon in the number column
signcol = col + len - 3;
else
signcol = col;
draw_sign = TRUE;
highlight_mask = 0;
}

View File

@@ -317,7 +317,7 @@ popup_handle_scrollbar_click(win_T *wp, int row, int col)
return;
if (row >= wp->w_popup_border[0]
&& row < height - wp->w_popup_border[2]
&& col == popup_width(wp) - 1)
&& col == popup_width(wp) - wp->w_popup_border[1] - 1)
{
if (row >= height / 2)
{
@@ -799,6 +799,8 @@ popup_height(win_T *wp)
int
popup_width(win_T *wp)
{
// w_leftcol is how many columns of the core are left of the screen
// w_popup_rightoff is how many columns of the core are right of the screen
return wp->w_width + wp->w_leftcol
+ wp->w_popup_padding[3] + wp->w_popup_border[3]
+ wp->w_popup_padding[1] + wp->w_popup_border[1]
@@ -924,7 +926,11 @@ popup_adjust_position(win_T *wp)
wp->w_width = maxwidth;
}
if (wp->w_width < len)
{
wp->w_width = len;
if (wp->w_maxwidth > 0 && wp->w_width > wp->w_maxwidth)
wp->w_width = wp->w_maxwidth;
}
// do not use the width of lines we're not going to show
if (wp->w_maxheight > 0
&& lnum - wp->w_topline + 1 + wrapped > wp->w_maxheight)
@@ -1506,6 +1512,12 @@ popup_highlight_curline(win_T *wp)
match_delete(wp, 1, FALSE);
// Scroll to show the line with the cursor. This assumes lines don't wrap.
while (wp->w_topline + wp->w_height - 1 < wp->w_cursor.lnum)
wp->w_topline++;
while (wp->w_cursor.lnum < wp->w_topline)
wp->w_topline--;
id = syn_name2id((char_u *)"PopupSelected");
vim_snprintf(buf, sizeof(buf), "\\%%%dl.*", (int)wp->w_cursor.lnum);
match_add(wp, (char_u *)(id == 0 ? "PmenuSel" : "PopupSelected"),
@@ -1890,6 +1902,20 @@ f_popup_getpos(typval_T *argvars, typval_T *rettv)
win_valid(wp) && (wp->w_popup_flags & POPF_HIDDEN) == 0);
}
}
/*
* popup_locate({row}, {col})
*/
void
f_popup_locate(typval_T *argvars, typval_T *rettv)
{
int row = tv_get_number(&argvars[0]) - 1;
int col = tv_get_number(&argvars[1]) - 1;
win_T *wp;
wp = mouse_find_win(&row, &col, FIND_POPUP);
if (WIN_IS_POPUP(wp))
rettv->vval.v_number = wp->w_id;
}
/*
* For popup_getoptions(): add a "border" or "padding" entry to "dict".
@@ -2323,8 +2349,10 @@ update_popup_transparent(win_T *wp, int val)
--lines;
if (lines < 0)
lines = 0;
for (line = lines; line < linee && line < screen_Rows; ++line)
for (col = cols; col < cole && col < screen_Columns; ++col)
for (line = lines; line < linee
&& line + wp->w_winrow < screen_Rows; ++line)
for (col = cols; col < cole
&& col + wp->w_wincol < screen_Columns; ++col)
popup_transparent[(line + wp->w_winrow) * screen_Columns
+ col + wp->w_wincol] = val;
}

View File

@@ -29,6 +29,7 @@ void close_all_popups(void);
void f_popup_move(typval_T *argvars, typval_T *rettv);
void f_popup_setoptions(typval_T *argvars, typval_T *rettv);
void f_popup_getpos(typval_T *argvars, typval_T *rettv);
void f_popup_locate(typval_T *argvars, typval_T *rettv);
void f_popup_getoptions(typval_T *argvars, typval_T *rettv);
int error_if_popup_window(void);
void popup_reset_handled(void);

View File

@@ -4809,7 +4809,7 @@ syn_cmd_include(exarg_T *eap, int syncing UNUSED)
* Everything that's left, up to the next command, should be the
* filename to include.
*/
eap->argt |= (XFILE | NOSPC);
eap->argt |= (EX_XFILE | EX_NOSPC);
separate_nextcmd(eap);
if (*eap->arg == '<' || *eap->arg == '$' || mch_isFullName(eap->arg))
{

View File

@@ -3425,11 +3425,15 @@ set_shellsize(int width, int height, int mustset)
if (State == HITRETURN || State == SETWSIZE)
{
/* postpone the resizing */
// postpone the resizing
State = SETWSIZE;
return;
}
if (updating_screen)
// resizing while in update_screen() may cause a crash
return;
/* curwin->w_buffer can be NULL when we are closing a window and the
* buffer has already been closed and removing a scrollbar causes a resize
* event. Don't resize then, it will happen after entering another buffer.

View File

@@ -0,0 +1,13 @@
>1+0&#ffffff0|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2
|1|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2
|1|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|x+0#0000001#ffd7ff255@8|8+0#0000000#ffffff0|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2
|1|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|y+0#0000001#ffd7ff255@8|8+0#0000000#ffffff0|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2
|1|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2
|1|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2
|1|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2
|1|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2
|1|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2
|1|2|3|4|5|6|7|8|9|1|0|1@2|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|2|7|2|8|2|9|3|0|3|1|3|2|3@2|4|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2
| +0&#e0e0e08@11|1+0&#ffffff0@1|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|2|6|═+0#0000001#ffd7ff255@13|X|4+0#0000000#ffffff0|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2
|o+0&#e0e0e08|m|e| |5+0&#ffffff0|6|7|t+0&#e0e0e08| @3|1+0&#ffffff0@1|2|1|3|1|4|1|5|1|6|1|7|1|8|1|9|2|0|2|1|2@2|3|2|4|2|5|║+0#0000001#ffd7ff255| @4|2+0#0000000#ffffff0|9|3| +0#0000001#ffd7ff255@6|║|4+0#0000000#ffffff0|3|5|3|6|3|7|3|8|3|9|4|0|4|1|4|2
|:|c|t+0&#e0e0e08|h|l+0&#ffffff0| |p|l+0&#e0e0e08|i|n|e| |m+0&#ffffff0|o|v|e|(|w|i|n|i|d|b|,| |{|'|p|o|s|'|:| |'|t|o|p|l|e|f|t|║+0#0000001#ffd7ff255| |j|u|s|t|l+0#0000000#ffffff0|'|:|e+0#0000001#ffd7ff255| |l|i|n|e| |║|,+0#0000000#ffffff0|1| @10|T|o|p|

View File

@@ -0,0 +1,13 @@
>╔+0#0000001#ffd7ff255|═@2|╗| +0#0000000#ffffff0@9|╔+0#0000001#ffd7ff255|═@11|╗| +0#0000000#ffffff0@2|╔+0#0000001#ffd7ff255|═@12|╗| +0#0000000#ffffff0@27
|║+0#0000001#ffd7ff255| @2|║| +0#0000000#ffffff0@9|║+0#0000001#ffd7ff255| @11|║| +0#0000000#ffffff0@2|║+0#0000001#ffd7ff255| @12|║| +0#0000000#ffffff0@27
|║+0#0000001#ffd7ff255| |x+0&#e0e0e08| +0&#ffd7ff255|║| +0#0000000#ffffff0@9|║+0#0000001#ffd7ff255| |1+0&#e0e0e08|2|3|4|5|6|7|8|9||| +0&#ffd7ff255|║| +0#0000000#ffffff0@2|║+0#0000001#ffd7ff255| |1+0&#e0e0e08|2|3|4|5|6|7|8|9||| +0&#ffd7ff255| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@27
|║+0#0000001#ffd7ff255| @2|║| +0#0000000#ffffff0@9|║+0#0000001#ffd7ff255| @11|║| +0#0000000#ffffff0@2|║+0#0000001#ffd7ff255| |1|2|3|4|5|6|7|8|9||| | +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@27
|╚+0#0000001#ffd7ff255|═@2|╝| +0#0000000#ffffff0@9|╚+0#0000001#ffd7ff255|═@11|╝| +0#0000000#ffffff0@2|║+0#0000001#ffd7ff255| |1|2|3|4|5|6|7|8|9||| | +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@27
|6| @30|║+0#0000001#ffd7ff255| @12|║| +0#0000000#ffffff0@27
|╔+0#0000001#ffd7ff255|═@11|╗| +0#0000000#ffffff0|╔+0#0000001#ffd7ff255|═@11|╗| +0#0000000#ffffff0@2|╚+0#0000001#ffd7ff255|═@12|╝| +0#0000000#ffffff0@27
|║+0#0000001#ffd7ff255| @11|║| +0#0000000#ffffff0|║+0#0000001#ffd7ff255| @11|║| +0#0000000#ffffff0@45
|║+0#0000001#ffd7ff255| |1+0&#e0e0e08|2|3|4|5|6|7|8|9||| +0&#ffd7ff255|║| +0#0000000#ffffff0|║+0#0000001#ffd7ff255| |1+0&#e0e0e08|2|3|4|5|6|7|8|9||| +0&#ffd7ff255|║| +0#0000000#ffffff0@45
|║+0#0000001#ffd7ff255| @11|║| +0#0000000#ffffff0|║+0#0000001#ffd7ff255| @11|║| +0#0000000#ffffff0@45
|╚+0#0000001#ffd7ff255|═@11|╝| +0#4040ff13#ffffff0|╚+0#0000001#ffd7ff255|═@11|╝| +0#4040ff13#ffffff0@45
|~| @73
| +0#0000000&@56|1|,|1| @10|A|l@1|

View File

@@ -0,0 +1,10 @@
>1+0&#ffffff0| @73
|2| @29|╔+0#0000001#ffd7ff255|═@10|╗| +0#0000000#ffffff0@30
|3| @29|║+0#0000001#ffd7ff255| @10|║| +0#0000000#ffffff0@30
|4| @29|║+0#0000001#ffd7ff255| |o|n|e| @5| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@30
|5| @29|║+0#0000001#ffd7ff255| |t+0&#e0e0e08|w|o| +0&#ffd7ff255@5| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@30
|6| @29|║+0#0000001#ffd7ff255| |t|h|r|e@1| @3| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@30
|7| @29|║+0#0000001#ffd7ff255| @10|║| +0#0000000#ffffff0@30
|8| @29|╚+0#0000001#ffd7ff255|═@10|╝| +0#0000000#ffffff0@30
|9| @73
@57|1|,|1| @10|T|o|p|

View File

@@ -0,0 +1,10 @@
>1+0&#ffffff0| @73
|2| @29|╔+0#0000001#ffd7ff255|═@10|╗| +0#0000000#ffffff0@30
|3| @29|║+0#0000001#ffd7ff255| @10|║| +0#0000000#ffffff0@30
|4| @29|║+0#0000001#ffd7ff255| |t|h|r|e@1| @3| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@30
|5| @29|║+0#0000001#ffd7ff255| |f|o|u|r| @4| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@30
|6| @29|║+0#0000001#ffd7ff255| |f+0&#e0e0e08|i|v|e| +0&#ffd7ff255@4| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@30
|7| @29|║+0#0000001#ffd7ff255| @10|║| +0#0000000#ffffff0@30
|8| @29|╚+0#0000001#ffd7ff255|═@10|╝| +0#0000000#ffffff0@30
|9| @73
@57|1|,|1| @10|T|o|p|

View File

@@ -0,0 +1,10 @@
>1+0&#ffffff0| @73
|2| @29|╔+0#0000001#ffd7ff255|═@10|╗| +0#0000000#ffffff0@30
|3| @29|║+0#0000001#ffd7ff255| @10|║| +0#0000000#ffffff0@30
|4| @29|║+0#0000001#ffd7ff255| |s|e|v|e|n| @3| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@30
|5| @29|║+0#0000001#ffd7ff255| |e|i|g|h|t| @3| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@30
|6| @29|║+0#0000001#ffd7ff255| |n+0&#e0e0e08|i|n|e| +0&#ffd7ff255@4| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@30
|7| @29|║+0#0000001#ffd7ff255| @10|║| +0#0000000#ffffff0@30
|8| @29|╚+0#0000001#ffd7ff255|═@10|╝| +0#0000000#ffffff0@30
|9| @73
@57|1|,|1| @10|T|o|p|

View File

@@ -0,0 +1,10 @@
>1+0&#ffffff0| @73
|2| @29|╔+0#0000001#ffd7ff255|═@10|╗| +0#0000000#ffffff0@30
|3| @29|║+0#0000001#ffd7ff255| @10|║| +0#0000000#ffffff0@30
|4| @29|║+0#0000001#ffd7ff255| |s+0&#e0e0e08|e|v|e|n| +0&#ffd7ff255@3| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@30
|5| @29|║+0#0000001#ffd7ff255| |e|i|g|h|t| @3| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@30
|6| @29|║+0#0000001#ffd7ff255| |n|i|n|e| @4| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@30
|7| @29|║+0#0000001#ffd7ff255| @10|║| +0#0000000#ffffff0@30
|8| @29|╚+0#0000001#ffd7ff255|═@10|╝| +0#0000000#ffffff0@30
|9| @73
@57|1|,|1| @10|T|o|p|

View File

@@ -0,0 +1,10 @@
>1+0&#ffffff0| @73
|2| @29|╔+0#0000001#ffd7ff255|═@10|╗| +0#0000000#ffffff0@30
|3| @29|║+0#0000001#ffd7ff255| @10|║| +0#0000000#ffffff0@30
|4| @29|║+0#0000001#ffd7ff255| |s+0&#e0e0e08|i|x| +0&#ffd7ff255@5| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@30
|5| @29|║+0#0000001#ffd7ff255| |s|e|v|e|n| @3| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@30
|6| @29|║+0#0000001#ffd7ff255| |e|i|g|h|t| @3| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@30
|7| @29|║+0#0000001#ffd7ff255| @10|║| +0#0000000#ffffff0@30
|8| @29|╚+0#0000001#ffd7ff255|═@10|╝| +0#0000000#ffffff0@30
|9| @73
@57|1|,|1| @10|T|o|p|

View File

@@ -0,0 +1,10 @@
>1+0&#ffffff0| @73
|2| @29|╔+0#0000001#ffd7ff255|═@10|╗| +0#0000000#ffffff0@30
|3| @29|║+0#0000001#ffd7ff255| @10|║| +0#0000000#ffffff0@30
|4| @29|║+0#0000001#ffd7ff255| |o+0&#e0e0e08|n|e| +0&#ffd7ff255@5| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@30
|5| @29|║+0#0000001#ffd7ff255| |t|w|o| @5| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@30
|6| @29|║+0#0000001#ffd7ff255| |t|h|r|e@1| @3| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@30
|7| @29|║+0#0000001#ffd7ff255| @10|║| +0#0000000#ffffff0@30
|8| @29|╚+0#0000001#ffd7ff255|═@10|╝| +0#0000000#ffffff0@30
|9| @73
@57|1|,|1| @10|T|o|p|

View File

@@ -1,10 +1,10 @@
>1+0&#ffffff0| @73
|2| @73
|3| @73
|4| @31|f+0#0000001#ffd7ff255|i|v|e| @3| +0#0000000#ff404010| +0&#ffffff0@32
|5| @31|s+0#0000001#ffd7ff255|i|x| @4| +0#0000000#ff404010| +0&#ffffff0@32
|6| @31|s+0#0000001#ffd7ff255|e|v|e|n| @2| +0#0000000#4040ff13| +0&#ffffff0@32
|7| @31|e+0#0000001#ffd7ff255|i|g|h|t| @2| +0#0000000#4040ff13| +0&#ffffff0@32
|8| @73
|3| @30|╔+0#0000001#ffd7ff255|═@8|X| +0#0000000#ffffff0@31
|4| @30|║+0#0000001#ffd7ff255|f|i|v|e| @3| +0#0000000#ff404010|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@31
|5| @30|║+0#0000001#ffd7ff255|s|i|x| @4| +0#0000000#ff404010|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@31
|6| @30|║+0#0000001#ffd7ff255|s|e|v|e|n| @2| +0#0000000#4040ff13|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@31
|7| @30|║+0#0000001#ffd7ff255|e|i|g|h|t| @2| +0#0000000#4040ff13|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@31
|8| @30|╚+0#0000001#ffd7ff255|═@8|╝| +0#0000000#ffffff0@31
|9| @73
|:|c|a|l@1| |C|l|i|c|k|B|o|t|(|)| @40|1|,|1| @10|T|o|p|

View File

@@ -68,10 +68,14 @@ set encoding=utf-8
let s:test_script_fname = expand('%')
au! SwapExists * call HandleSwapExists()
func HandleSwapExists()
" Only ignore finding a swap file for the test script (the user might be
" Ignore finding a swap file for the test script (the user might be
" editing it and do ":make test_name") and the output file.
" Report finding another swap file and chose 'q' to avoid getting stuck.
if expand('<afile>') == 'messages' || expand('<afile>') =~ s:test_script_fname
let v:swapchoice = 'e'
else
call assert_report('Unexpected swap file: ' .. v:swapname)
let v:swapchoice = 'q'
endif
endfunc

View File

@@ -71,6 +71,10 @@ func Test_blob_assign()
call assert_fails('let b .= "xx"', 'E734:')
call assert_fails('let b += "xx"', 'E734:')
call assert_fails('let b[1:1] .= 0z55', 'E734:')
let l = [0z12]
let m = deepcopy(l)
let m[0] = 0z34 " E742 or E741 should not occur.
endfunc
func Test_blob_get_range()

View File

@@ -486,6 +486,10 @@ func Test_popup_with_mask()
call term_sendkeys(buf, ":call popup_move(winidb, {'pos': 'topright', 'col': 12})\<CR>")
call VerifyScreenDump(buf, 'Test_popupwin_mask_4', {})
call term_sendkeys(buf, ":call popup_move(winid, {'pos': 'topright', 'col': 12, 'line': 11})\<CR>")
call term_sendkeys(buf, ":call popup_move(winidb, {'pos': 'topleft', 'col': 42, 'line': 11})\<CR>")
call VerifyScreenDump(buf, 'Test_popupwin_mask_5', {})
" clean up
call StopVimInTerminal(buf)
call delete('XtestPopupMask')
@@ -521,6 +525,9 @@ func Test_popup_select()
call term_sendkeys(buf, ":call popup_close(winid)\<CR>")
call term_sendkeys(buf, "\"*p")
" clean the command line, sometimes it still shows a command
call term_sendkeys(buf, ":\<esc>")
call VerifyScreenDump(buf, 'Test_popupwin_select_02', {})
" clean up
@@ -706,7 +713,7 @@ func Test_popup_time()
topleft vnew
call setline(1, 'hello')
call popup_create('world', {
let winid = popup_create('world', {
\ 'line': 1,
\ 'col': 1,
\ 'minwidth': 20,
@@ -716,6 +723,11 @@ func Test_popup_time()
let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '')
call assert_equal('world', line)
call assert_equal(winid, popup_locate(1, 1))
call assert_equal(winid, popup_locate(1, 20))
call assert_equal(0, popup_locate(1, 21))
call assert_equal(0, popup_locate(2, 1))
sleep 700m
redraw
let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '')
@@ -1576,6 +1588,7 @@ func Test_popup_scrollbar()
call feedkeys("\<F4>\<LeftMouse>", "xt")
endfunc
func ClickBot()
call popup_setoptions(g:winid, {'border': [], 'close': 'button'})
call feedkeys("\<F5>\<LeftMouse>", "xt")
endfunc
map <silent> <F3> :call test_setmouse(5, 36)<CR>
@@ -1806,3 +1819,92 @@ func Test_popupwin_buf_close()
call assert_equal([], bufinfo.popups)
exe 'bwipe! ' .. buf
endfunc
func Test_popup_menu_with_maxwidth()
if !CanRunVimInTerminal()
throw 'Skipped: cannot make screendumps'
endif
let lines =<< trim END
call setline(1, range(1, 10))
hi ScrollThumb ctermbg=blue
hi ScrollBar ctermbg=red
func PopupMenu(lines, line, col, scrollbar = 0)
return popup_menu(a:lines, {
\ 'maxwidth': 10,
\ 'maxheight': 3,
\ 'pos' : 'topleft',
\ 'col' : a:col,
\ 'line' : a:line,
\ 'scrollbar' : a:scrollbar,
\ })
endfunc
call PopupMenu(['x'], 1, 1)
call PopupMenu(['123456789|'], 1, 16)
call PopupMenu(['123456789|' .. ' '], 7, 1)
call PopupMenu([repeat('123456789|', 100)], 7, 16)
call PopupMenu(repeat(['123456789|' .. ' '], 5), 1, 33, 1)
END
call writefile(lines, 'XtestPopupMenuMaxWidth')
let buf = RunVimInTerminal('-S XtestPopupMenuMaxWidth', {'rows': 13})
call VerifyScreenDump(buf, 'Test_popupwin_menu_maxwidth_1', {})
" close the menu popupwin.
call term_sendkeys(buf, " ")
call term_sendkeys(buf, " ")
call term_sendkeys(buf, " ")
call term_sendkeys(buf, " ")
call term_sendkeys(buf, " ")
" clean up
call StopVimInTerminal(buf)
call delete('XtestPopupMenuMaxWidth')
endfunc
func Test_popup_menu_with_scrollbar()
if !CanRunVimInTerminal()
throw 'Skipped: cannot make screendumps'
endif
let lines =<< trim END
call setline(1, range(1, 20))
hi ScrollThumb ctermbg=blue
hi ScrollBar ctermbg=red
call popup_menu(['one', 'two', 'three', 'four', 'five',
\ 'six', 'seven', 'eight', 'nine'], {
\ 'minwidth': 8,
\ 'maxheight': 3,
\ })
END
call writefile(lines, 'XtestPopupMenuScroll')
let buf = RunVimInTerminal('-S XtestPopupMenuScroll', {'rows': 10})
call term_sendkeys(buf, "j")
call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_1', {})
call term_sendkeys(buf, "jjj")
call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_2', {})
" if the cursor is the bottom line, it stays at the bottom line.
call term_sendkeys(buf, repeat("j", 20))
call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_3', {})
call term_sendkeys(buf, "kk")
call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_4', {})
call term_sendkeys(buf, "k")
call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_5', {})
" if the cursor is in the top line, it stays in the top line.
call term_sendkeys(buf, repeat("k", 20))
call VerifyScreenDump(buf, 'Test_popupwin_menu_scroll_6', {})
" close the menu popupwin.
call term_sendkeys(buf, " ")
" clean up
call StopVimInTerminal(buf)
call delete('XtestPopupMenuScroll')
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -42,6 +42,8 @@ function Test_window_cmd_wincmd_gf()
function s:swap_exists()
let v:swapchoice = s:swap_choice
endfunc
" Remove the catch-all that runtest.vim adds
au! SwapExists
augroup test_window_cmd_wincmd_gf
autocmd!
exec "autocmd SwapExists " . fname . " call s:swap_exists()"

View File

@@ -419,12 +419,12 @@ uc_list(char_u *name, size_t name_len)
// Special cases
len = 4;
if (a & BANG)
if (a & EX_BANG)
{
msg_putchar('!');
--len;
}
if (a & REGSTR)
if (a & EX_REGSTR)
{
msg_putchar('"');
--len;
@@ -434,7 +434,7 @@ uc_list(char_u *name, size_t name_len)
msg_putchar('b');
--len;
}
if (a & TRLBAR)
if (a & EX_TRLBAR)
{
msg_putchar('|');
--len;
@@ -456,13 +456,13 @@ uc_list(char_u *name, size_t name_len)
len = 0;
// Arguments
switch ((int)(a & (EXTRA|NOSPC|NEEDARG)))
switch ((int)(a & (EX_EXTRA|EX_NOSPC|EX_NEEDARG)))
{
case 0: IObuff[len++] = '0'; break;
case (EXTRA): IObuff[len++] = '*'; break;
case (EXTRA|NOSPC): IObuff[len++] = '?'; break;
case (EXTRA|NEEDARG): IObuff[len++] = '+'; break;
case (EXTRA|NOSPC|NEEDARG): IObuff[len++] = '1'; break;
case 0: IObuff[len++] = '0'; break;
case (EX_EXTRA): IObuff[len++] = '*'; break;
case (EX_EXTRA|EX_NOSPC): IObuff[len++] = '?'; break;
case (EX_EXTRA|EX_NEEDARG): IObuff[len++] = '+'; break;
case (EX_EXTRA|EX_NOSPC|EX_NEEDARG): IObuff[len++] = '1'; break;
}
do {
@@ -470,15 +470,15 @@ uc_list(char_u *name, size_t name_len)
} while (len < 5 - over);
// Address / Range
if (a & (RANGE|COUNT))
if (a & (EX_RANGE|EX_COUNT))
{
if (a & COUNT)
if (a & EX_COUNT)
{
// -count=N
sprintf((char *)IObuff + len, "%ldc", cmd->uc_def);
len += (int)STRLEN(IObuff + len);
}
else if (a & DFLALL)
else if (a & EX_DFLALL)
IObuff[len++] = '%';
else if (cmd->uc_def >= 0)
{
@@ -638,10 +638,10 @@ parse_compl_arg(
{
*complp = command_complete[i].expand;
if (command_complete[i].expand == EXPAND_BUFFERS)
*argt |= BUFNAME;
*argt |= EX_BUFNAME;
else if (command_complete[i].expand == EXPAND_DIRECTORIES
|| command_complete[i].expand == EXPAND_FILES)
*argt |= XFILE;
*argt |= EX_XFILE;
break;
}
}
@@ -702,13 +702,13 @@ uc_scan_attr(
// First, try the simple attributes (no arguments)
if (STRNICMP(attr, "bang", len) == 0)
*argt |= BANG;
*argt |= EX_BANG;
else if (STRNICMP(attr, "buffer", len) == 0)
*flags |= UC_BUFFER;
else if (STRNICMP(attr, "register", len) == 0)
*argt |= REGSTR;
*argt |= EX_REGSTR;
else if (STRNICMP(attr, "bar", len) == 0)
*argt |= TRLBAR;
*argt |= EX_TRLBAR;
else
{
int i;
@@ -736,13 +736,13 @@ uc_scan_attr(
// Do nothing - this is the default
;
else if (*val == '1')
*argt |= (EXTRA | NOSPC | NEEDARG);
*argt |= (EX_EXTRA | EX_NOSPC | EX_NEEDARG);
else if (*val == '*')
*argt |= EXTRA;
*argt |= EX_EXTRA;
else if (*val == '?')
*argt |= (EXTRA | NOSPC);
*argt |= (EX_EXTRA | EX_NOSPC);
else if (*val == '+')
*argt |= (EXTRA | NEEDARG);
*argt |= (EX_EXTRA | EX_NEEDARG);
else
goto wrong_nargs;
}
@@ -755,9 +755,9 @@ wrong_nargs:
}
else if (STRNICMP(attr, "range", attrlen) == 0)
{
*argt |= RANGE;
*argt |= EX_RANGE;
if (vallen == 1 && *val == '%')
*argt |= DFLALL;
*argt |= EX_DFLALL;
else if (val != NULL)
{
p = val;
@@ -769,7 +769,7 @@ two_count:
}
*def = getdigits(&p);
*argt |= ZEROR;
*argt |= EX_ZEROR;
if (p != val + vallen || vallen == 0)
{
@@ -784,7 +784,7 @@ invalid_count:
}
else if (STRNICMP(attr, "count", attrlen) == 0)
{
*argt |= (COUNT | ZEROR | RANGE);
*argt |= (EX_COUNT | EX_ZEROR | EX_RANGE);
// default for -count is using any number
if (*addr_type_arg == ADDR_NONE)
*addr_type_arg = ADDR_OTHER;
@@ -818,7 +818,7 @@ invalid_count:
}
else if (STRNICMP(attr, "addr", attrlen) == 0)
{
*argt |= RANGE;
*argt |= EX_RANGE;
if (val == NULL)
{
emsg(_("E179: argument required for -addr"));
@@ -827,7 +827,7 @@ invalid_count:
if (parse_addr_type_arg(val, (int)vallen, addr_type_arg) == FAIL)
return FAIL;
if (*addr_type_arg != ADDR_LINES)
*argt |= ZEROR;
*argt |= EX_ZEROR;
}
else
{
@@ -1315,7 +1315,7 @@ uc_check_code(
// When specified there is a single argument don't split it.
// Works for ":Cmd %" when % is "a b c".
if ((eap->argt & NOSPC) && quote == 2)
if ((eap->argt & EX_NOSPC) && quote == 2)
quote = 1;
switch (quote)

View File

@@ -777,6 +777,38 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1679,
/**/
1678,
/**/
1677,
/**/
1676,
/**/
1675,
/**/
1674,
/**/
1673,
/**/
1672,
/**/
1671,
/**/
1670,
/**/
1669,
/**/
1668,
/**/
1667,
/**/
1666,
/**/
1665,
/**/
1664,
/**/
1663,
/**/