mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.3146: Vim9: line number wrong for :execute argument
Problem: Vim9: line number wrong for :execute argument. Solution: Use the line number of the :execute command itself. (closes #8537)
This commit is contained in:
@@ -6191,6 +6191,7 @@ ex_execute(exarg_T *eap)
|
|||||||
char_u *p;
|
char_u *p;
|
||||||
garray_T ga;
|
garray_T ga;
|
||||||
int len;
|
int len;
|
||||||
|
long start_lnum = SOURCING_LNUM;
|
||||||
|
|
||||||
ga_init2(&ga, 1, 80);
|
ga_init2(&ga, 1, 80);
|
||||||
|
|
||||||
@@ -6244,6 +6245,9 @@ ex_execute(exarg_T *eap)
|
|||||||
|
|
||||||
if (ret != FAIL && ga.ga_data != NULL)
|
if (ret != FAIL && ga.ga_data != NULL)
|
||||||
{
|
{
|
||||||
|
// use the first line of continuation lines for messages
|
||||||
|
SOURCING_LNUM = start_lnum;
|
||||||
|
|
||||||
if (eap->cmdidx == CMD_echomsg || eap->cmdidx == CMD_echoerr)
|
if (eap->cmdidx == CMD_echomsg || eap->cmdidx == CMD_echoerr)
|
||||||
{
|
{
|
||||||
// Mark the already saved text as finishing the line, so that what
|
// Mark the already saved text as finishing the line, so that what
|
||||||
|
@@ -4167,6 +4167,16 @@ def Test_option_modifier()
|
|||||||
set hlsearch&
|
set hlsearch&
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
|
" This must be called last, it may cause following :def functions to fail
|
||||||
|
def Test_xxx_echoerr_line_number()
|
||||||
|
var lines =<< trim END
|
||||||
|
echoerr 'some'
|
||||||
|
.. ' error'
|
||||||
|
.. ' continued'
|
||||||
|
END
|
||||||
|
CheckDefExecAndScriptFailure(lines, 'some error continued', 1)
|
||||||
|
enddef
|
||||||
|
|
||||||
def ProfiledFunc()
|
def ProfiledFunc()
|
||||||
var n = 3
|
var n = 3
|
||||||
echo [[1, 2], [3, 4]]->filter((_, l) => l[0] == n)
|
echo [[1, 2], [3, 4]]->filter((_, l) => l[0] == n)
|
||||||
|
@@ -755,6 +755,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
3146,
|
||||||
/**/
|
/**/
|
||||||
3145,
|
3145,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user