|
Karsten Hopp |
439679 |
To: vim_dev@googlegroups.com
|
|
Karsten Hopp |
439679 |
Subject: Patch 7.4.745
|
|
Karsten Hopp |
439679 |
Fcc: outbox
|
|
Karsten Hopp |
439679 |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
439679 |
Mime-Version: 1.0
|
|
Karsten Hopp |
439679 |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
439679 |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
439679 |
------------
|
|
Karsten Hopp |
439679 |
|
|
Karsten Hopp |
439679 |
Patch 7.4.745
|
|
Karsten Hopp |
439679 |
Problem: The entries added by matchaddpos() are returned by getmatches()
|
|
Karsten Hopp |
439679 |
but can't be set with setmatches(). (Lcd)
|
|
Karsten Hopp |
439679 |
Solution: Fix setmatches(). (Christian Brabandt)
|
|
Karsten Hopp |
439679 |
Files: src/eval.c, src/testdir/test63.in, src/testdir/test63.ok
|
|
Karsten Hopp |
439679 |
|
|
Karsten Hopp |
439679 |
|
|
Karsten Hopp |
439679 |
*** ../vim-7.4.744/src/eval.c 2015-06-19 12:08:08.230151195 +0200
|
|
Karsten Hopp |
439679 |
--- src/eval.c 2015-06-19 16:27:05.567692144 +0200
|
|
Karsten Hopp |
439679 |
***************
|
|
Karsten Hopp |
439679 |
*** 17118,17123 ****
|
|
Karsten Hopp |
439679 |
--- 17118,17124 ----
|
|
Karsten Hopp |
439679 |
list_T *l;
|
|
Karsten Hopp |
439679 |
listitem_T *li;
|
|
Karsten Hopp |
439679 |
dict_T *d;
|
|
Karsten Hopp |
439679 |
+ list_T *s = NULL;
|
|
Karsten Hopp |
439679 |
|
|
Karsten Hopp |
439679 |
rettv->vval.v_number = -1;
|
|
Karsten Hopp |
439679 |
if (argvars[0].v_type != VAR_LIST)
|
|
Karsten Hopp |
439679 |
***************
|
|
Karsten Hopp |
439679 |
*** 17140,17146 ****
|
|
Karsten Hopp |
439679 |
return;
|
|
Karsten Hopp |
439679 |
}
|
|
Karsten Hopp |
439679 |
if (!(dict_find(d, (char_u *)"group", -1) != NULL
|
|
Karsten Hopp |
439679 |
! && dict_find(d, (char_u *)"pattern", -1) != NULL
|
|
Karsten Hopp |
439679 |
&& dict_find(d, (char_u *)"priority", -1) != NULL
|
|
Karsten Hopp |
439679 |
&& dict_find(d, (char_u *)"id", -1) != NULL))
|
|
Karsten Hopp |
439679 |
{
|
|
Karsten Hopp |
439679 |
--- 17141,17148 ----
|
|
Karsten Hopp |
439679 |
return;
|
|
Karsten Hopp |
439679 |
}
|
|
Karsten Hopp |
439679 |
if (!(dict_find(d, (char_u *)"group", -1) != NULL
|
|
Karsten Hopp |
439679 |
! && (dict_find(d, (char_u *)"pattern", -1) != NULL
|
|
Karsten Hopp |
439679 |
! || dict_find(d, (char_u *)"pos1", -1) != NULL)
|
|
Karsten Hopp |
439679 |
&& dict_find(d, (char_u *)"priority", -1) != NULL
|
|
Karsten Hopp |
439679 |
&& dict_find(d, (char_u *)"id", -1) != NULL))
|
|
Karsten Hopp |
439679 |
{
|
|
Karsten Hopp |
439679 |
***************
|
|
Karsten Hopp |
439679 |
*** 17154,17164 ****
|
|
Karsten Hopp |
439679 |
li = l->lv_first;
|
|
Karsten Hopp |
439679 |
while (li != NULL)
|
|
Karsten Hopp |
439679 |
{
|
|
Karsten Hopp |
439679 |
d = li->li_tv.vval.v_dict;
|
|
Karsten Hopp |
439679 |
! match_add(curwin, get_dict_string(d, (char_u *)"group", FALSE),
|
|
Karsten Hopp |
439679 |
get_dict_string(d, (char_u *)"pattern", FALSE),
|
|
Karsten Hopp |
439679 |
(int)get_dict_number(d, (char_u *)"priority"),
|
|
Karsten Hopp |
439679 |
(int)get_dict_number(d, (char_u *)"id"), NULL);
|
|
Karsten Hopp |
439679 |
li = li->li_next;
|
|
Karsten Hopp |
439679 |
}
|
|
Karsten Hopp |
439679 |
rettv->vval.v_number = 0;
|
|
Karsten Hopp |
439679 |
--- 17156,17208 ----
|
|
Karsten Hopp |
439679 |
li = l->lv_first;
|
|
Karsten Hopp |
439679 |
while (li != NULL)
|
|
Karsten Hopp |
439679 |
{
|
|
Karsten Hopp |
439679 |
+ int i = 0;
|
|
Karsten Hopp |
439679 |
+ char_u buf[4];
|
|
Karsten Hopp |
439679 |
+ dictitem_T *di;
|
|
Karsten Hopp |
439679 |
+
|
|
Karsten Hopp |
439679 |
d = li->li_tv.vval.v_dict;
|
|
Karsten Hopp |
439679 |
!
|
|
Karsten Hopp |
439679 |
! if (dict_find(d, (char_u *)"pattern", -1) == NULL)
|
|
Karsten Hopp |
439679 |
! {
|
|
Karsten Hopp |
439679 |
! if (s == NULL)
|
|
Karsten Hopp |
439679 |
! {
|
|
Karsten Hopp |
439679 |
! s = list_alloc();
|
|
Karsten Hopp |
439679 |
! if (s == NULL)
|
|
Karsten Hopp |
439679 |
! return;
|
|
Karsten Hopp |
439679 |
! }
|
|
Karsten Hopp |
439679 |
!
|
|
Karsten Hopp |
439679 |
! /* match from matchaddpos() */
|
|
Karsten Hopp |
439679 |
! for (i = 1; i < 9; i++)
|
|
Karsten Hopp |
439679 |
! {
|
|
Karsten Hopp |
439679 |
! sprintf((char *)buf, (char *)"pos%d", i);
|
|
Karsten Hopp |
439679 |
! if ((di = dict_find(d, (char_u *)buf, -1)) != NULL)
|
|
Karsten Hopp |
439679 |
! {
|
|
Karsten Hopp |
439679 |
! if (di->di_tv.v_type != VAR_LIST)
|
|
Karsten Hopp |
439679 |
! return;
|
|
Karsten Hopp |
439679 |
!
|
|
Karsten Hopp |
439679 |
! list_append_tv(s, &di->di_tv);
|
|
Karsten Hopp |
439679 |
! s->lv_refcount++;
|
|
Karsten Hopp |
439679 |
! }
|
|
Karsten Hopp |
439679 |
! else
|
|
Karsten Hopp |
439679 |
! break;
|
|
Karsten Hopp |
439679 |
! }
|
|
Karsten Hopp |
439679 |
! }
|
|
Karsten Hopp |
439679 |
! if (i == 0)
|
|
Karsten Hopp |
439679 |
! {
|
|
Karsten Hopp |
439679 |
! match_add(curwin, get_dict_string(d, (char_u *)"group", FALSE),
|
|
Karsten Hopp |
439679 |
get_dict_string(d, (char_u *)"pattern", FALSE),
|
|
Karsten Hopp |
439679 |
(int)get_dict_number(d, (char_u *)"priority"),
|
|
Karsten Hopp |
439679 |
(int)get_dict_number(d, (char_u *)"id"), NULL);
|
|
Karsten Hopp |
439679 |
+ }
|
|
Karsten Hopp |
439679 |
+ else
|
|
Karsten Hopp |
439679 |
+ {
|
|
Karsten Hopp |
439679 |
+ match_add(curwin, get_dict_string(d, (char_u *)"group", FALSE),
|
|
Karsten Hopp |
439679 |
+ NULL, (int)get_dict_number(d, (char_u *)"priority"),
|
|
Karsten Hopp |
439679 |
+ (int)get_dict_number(d, (char_u *)"id"), s);
|
|
Karsten Hopp |
439679 |
+ list_unref(s);
|
|
Karsten Hopp |
439679 |
+ s = NULL;
|
|
Karsten Hopp |
439679 |
+ }
|
|
Karsten Hopp |
439679 |
+
|
|
Karsten Hopp |
439679 |
li = li->li_next;
|
|
Karsten Hopp |
439679 |
}
|
|
Karsten Hopp |
439679 |
rettv->vval.v_number = 0;
|
|
Karsten Hopp |
439679 |
*** ../vim-7.4.744/src/testdir/test63.in 2014-11-27 18:57:07.468605191 +0100
|
|
Karsten Hopp |
439679 |
--- src/testdir/test63.in 2015-06-19 16:22:09.866738185 +0200
|
|
Karsten Hopp |
439679 |
***************
|
|
Karsten Hopp |
439679 |
*** 187,193 ****
|
|
Karsten Hopp |
439679 |
--- 187,198 ----
|
|
Karsten Hopp |
439679 |
:else
|
|
Karsten Hopp |
439679 |
: let @r .= "FAILED: " . v4 . "/" . v5 . "/" . v6 . "/" . v7 . "/" . v8 . "/" . v9 . "/" . v10 . "\n"
|
|
Karsten Hopp |
439679 |
:endif
|
|
Karsten Hopp |
439679 |
+ :" Check, that setmatches() can correctly restore the matches from matchaddpos()
|
|
Karsten Hopp |
439679 |
+ :call matchadd('MyGroup1', '\%2lmatchadd')
|
|
Karsten Hopp |
439679 |
+ :let m=getmatches()
|
|
Karsten Hopp |
439679 |
:call clearmatches()
|
|
Karsten Hopp |
439679 |
+ :call setmatches(m)
|
|
Karsten Hopp |
439679 |
+ :let @r .= string(getmatches())."\n"
|
|
Karsten Hopp |
439679 |
G"rp
|
|
Karsten Hopp |
439679 |
:/^Results/,$wq! test.out
|
|
Karsten Hopp |
439679 |
ENDTEST
|
|
Karsten Hopp |
439679 |
*** ../vim-7.4.744/src/testdir/test63.ok 2014-08-16 16:28:31.882272056 +0200
|
|
Karsten Hopp |
439679 |
--- src/testdir/test63.ok 2015-06-19 16:22:09.866738185 +0200
|
|
Karsten Hopp |
439679 |
***************
|
|
Karsten Hopp |
439679 |
*** 14,16 ****
|
|
Karsten Hopp |
439679 |
--- 14,17 ----
|
|
Karsten Hopp |
439679 |
OK
|
|
Karsten Hopp |
439679 |
[{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1, 9, 2]}]
|
|
Karsten Hopp |
439679 |
OK
|
|
Karsten Hopp |
439679 |
+ [{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1, 9, 2]}, {'group': 'MyGroup1', 'pattern': '\%2lmatchadd', 'priority': 10, 'id': 12}]
|
|
Karsten Hopp |
439679 |
*** ../vim-7.4.744/src/version.c 2015-06-19 15:45:13.005889121 +0200
|
|
Karsten Hopp |
439679 |
--- src/version.c 2015-06-19 16:20:56.127497363 +0200
|
|
Karsten Hopp |
439679 |
***************
|
|
Karsten Hopp |
439679 |
*** 743,744 ****
|
|
Karsten Hopp |
439679 |
--- 743,746 ----
|
|
Karsten Hopp |
439679 |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
439679 |
+ /**/
|
|
Karsten Hopp |
439679 |
+ 745,
|
|
Karsten Hopp |
439679 |
/**/
|
|
Karsten Hopp |
439679 |
|
|
Karsten Hopp |
439679 |
--
|
|
Karsten Hopp |
439679 |
An actual excerpt from a classified section of a city newspaper:
|
|
Karsten Hopp |
439679 |
"Illiterate? Write today for free help!"
|
|
Karsten Hopp |
439679 |
|
|
Karsten Hopp |
439679 |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
439679 |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
439679 |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
Karsten Hopp |
439679 |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|