|
|
3ef2ca |
To: vim_dev@googlegroups.com
|
|
|
3ef2ca |
Subject: Patch 7.4.485
|
|
|
3ef2ca |
Fcc: outbox
|
|
|
3ef2ca |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
|
3ef2ca |
Mime-Version: 1.0
|
|
|
3ef2ca |
Content-Type: text/plain; charset=UTF-8
|
|
|
3ef2ca |
Content-Transfer-Encoding: 8bit
|
|
|
3ef2ca |
------------
|
|
|
3ef2ca |
|
|
|
3ef2ca |
Patch 7.4.485 (after 7.4.484)
|
|
|
3ef2ca |
Problem: Abbreviations don't work. (Toothpik)
|
|
|
3ef2ca |
Solution: Move the length computation inside the for loop. Compare against
|
|
|
3ef2ca |
the unescaped key.
|
|
|
3ef2ca |
Files: src/getchar.c
|
|
|
3ef2ca |
|
|
|
3ef2ca |
|
|
|
3ef2ca |
*** ../vim-7.4.484/src/getchar.c 2014-10-21 18:17:05.638274024 +0200
|
|
|
3ef2ca |
--- src/getchar.c 2014-10-21 19:30:46.262283680 +0200
|
|
|
3ef2ca |
***************
|
|
|
3ef2ca |
*** 4443,4449 ****
|
|
|
3ef2ca |
#endif
|
|
|
3ef2ca |
int is_id = TRUE;
|
|
|
3ef2ca |
int vim_abbr;
|
|
|
3ef2ca |
- int qlen; /* length of q, CSI/K_SPECIAL unescaped */
|
|
|
3ef2ca |
|
|
|
3ef2ca |
if (typebuf.tb_no_abbr_cnt) /* abbrev. are not recursive */
|
|
|
3ef2ca |
return FALSE;
|
|
|
3ef2ca |
--- 4443,4448 ----
|
|
|
3ef2ca |
***************
|
|
|
3ef2ca |
*** 4521,4549 ****
|
|
|
3ef2ca |
#else
|
|
|
3ef2ca |
mp = first_abbr;
|
|
|
3ef2ca |
#endif
|
|
|
3ef2ca |
- qlen = mp->m_keylen;
|
|
|
3ef2ca |
- if (vim_strbyte(mp->m_keys, K_SPECIAL) != NULL)
|
|
|
3ef2ca |
- {
|
|
|
3ef2ca |
- char_u *q = vim_strsave(mp->m_keys);
|
|
|
3ef2ca |
-
|
|
|
3ef2ca |
- /* might have CSI escaped mp->m_keys */
|
|
|
3ef2ca |
- if (q != NULL)
|
|
|
3ef2ca |
- {
|
|
|
3ef2ca |
- vim_unescape_csi(q);
|
|
|
3ef2ca |
- qlen = (int)STRLEN(q);
|
|
|
3ef2ca |
- vim_free(q);
|
|
|
3ef2ca |
- }
|
|
|
3ef2ca |
- }
|
|
|
3ef2ca |
for ( ; mp;
|
|
|
3ef2ca |
#ifdef FEAT_LOCALMAP
|
|
|
3ef2ca |
mp->m_next == NULL ? (mp = mp2, mp2 = NULL) :
|
|
|
3ef2ca |
#endif
|
|
|
3ef2ca |
(mp = mp->m_next))
|
|
|
3ef2ca |
{
|
|
|
3ef2ca |
/* find entries with right mode and keys */
|
|
|
3ef2ca |
! if ( (mp->m_mode & State)
|
|
|
3ef2ca |
&& qlen == len
|
|
|
3ef2ca |
! && !STRNCMP(mp->m_keys, ptr, (size_t)len))
|
|
|
3ef2ca |
break;
|
|
|
3ef2ca |
}
|
|
|
3ef2ca |
if (mp != NULL)
|
|
|
3ef2ca |
--- 4520,4553 ----
|
|
|
3ef2ca |
#else
|
|
|
3ef2ca |
mp = first_abbr;
|
|
|
3ef2ca |
#endif
|
|
|
3ef2ca |
for ( ; mp;
|
|
|
3ef2ca |
#ifdef FEAT_LOCALMAP
|
|
|
3ef2ca |
mp->m_next == NULL ? (mp = mp2, mp2 = NULL) :
|
|
|
3ef2ca |
#endif
|
|
|
3ef2ca |
(mp = mp->m_next))
|
|
|
3ef2ca |
{
|
|
|
3ef2ca |
+ int qlen = mp->m_keylen;
|
|
|
3ef2ca |
+ char_u *q = mp->m_keys;
|
|
|
3ef2ca |
+ int match;
|
|
|
3ef2ca |
+
|
|
|
3ef2ca |
+ if (vim_strbyte(mp->m_keys, K_SPECIAL) != NULL)
|
|
|
3ef2ca |
+ {
|
|
|
3ef2ca |
+ /* might have CSI escaped mp->m_keys */
|
|
|
3ef2ca |
+ q = vim_strsave(mp->m_keys);
|
|
|
3ef2ca |
+ if (q != NULL)
|
|
|
3ef2ca |
+ {
|
|
|
3ef2ca |
+ vim_unescape_csi(q);
|
|
|
3ef2ca |
+ qlen = (int)STRLEN(q);
|
|
|
3ef2ca |
+ }
|
|
|
3ef2ca |
+ }
|
|
|
3ef2ca |
+
|
|
|
3ef2ca |
/* find entries with right mode and keys */
|
|
|
3ef2ca |
! match = (mp->m_mode & State)
|
|
|
3ef2ca |
&& qlen == len
|
|
|
3ef2ca |
! && !STRNCMP(q, ptr, (size_t)len);
|
|
|
3ef2ca |
! if (q != mp->m_keys)
|
|
|
3ef2ca |
! vim_free(q);
|
|
|
3ef2ca |
! if (match)
|
|
|
3ef2ca |
break;
|
|
|
3ef2ca |
}
|
|
|
3ef2ca |
if (mp != NULL)
|
|
|
3ef2ca |
*** ../vim-7.4.484/src/version.c 2014-10-21 18:17:05.638274024 +0200
|
|
|
3ef2ca |
--- src/version.c 2014-10-21 19:34:55.338284224 +0200
|
|
|
3ef2ca |
***************
|
|
|
3ef2ca |
*** 743,744 ****
|
|
|
3ef2ca |
--- 743,746 ----
|
|
|
3ef2ca |
{ /* Add new patch number below this line */
|
|
|
3ef2ca |
+ /**/
|
|
|
3ef2ca |
+ 485,
|
|
|
3ef2ca |
/**/
|
|
|
3ef2ca |
|
|
|
3ef2ca |
--
|
|
|
3ef2ca |
TALL KNIGHT: We shall say Ni! again to you if you do not appease us.
|
|
|
3ef2ca |
ARTHUR: All right! What do you want?
|
|
|
3ef2ca |
TALL KNIGHT: We want ... a shrubbery!
|
|
|
3ef2ca |
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
|
|
|
3ef2ca |
|
|
|
3ef2ca |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
|
3ef2ca |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
|
3ef2ca |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
|
3ef2ca |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|