Patch 7.2.426

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Patch 7.2.426

Bram Moolenaar

Patch 7.2.426
Problem:    Commas in 'langmap' are not always handled correctly.
Solution:   Require commas to be backslash escaped. (James Vega)
Files:    src/option.c


*** ../vim-7.2.425/src/option.c 2010-05-13 13:12:01.000000000 +0200
--- src/option.c 2010-05-14 16:04:21.000000000 +0200
***************
*** 10432,10437 ****
--- 10432,10442 ----
     p2 = NULL;    /* aAbBcCdD form, p2 is NULL */
  while (p[0])
  {
+    if (p[0] == ',')
+    {
+ ++p;
+ break;
+    }
     if (p[0] == '\\' && p[1] != NUL)
  ++p;
  #ifdef FEAT_MBYTE
***************
*** 10439,10464 ****
  #else
     from = p[0];
  #endif
     if (p2 == NULL)
     {
  mb_ptr_adv(p);
! if (p[0] == '\\')
!    ++p;
  #ifdef FEAT_MBYTE
! to = (*mb_ptr2char)(p);
  #else
! to = p[0];
  #endif
     }
     else
     {
! if (p2[0] == '\\')
!    ++p2;
  #ifdef FEAT_MBYTE
! to = (*mb_ptr2char)(p2);
  #else
! to = p2[0];
  #endif
     }
     if (to == NUL)
     {
--- 10444,10476 ----
  #else
     from = p[0];
  #endif
+    to = NUL;
     if (p2 == NULL)
     {
  mb_ptr_adv(p);
! if (p[0] != ',')
! {
!    if (p[0] == '\\')
! ++p;
  #ifdef FEAT_MBYTE
!    to = (*mb_ptr2char)(p);
  #else
!    to = p[0];
  #endif
+ }
     }
     else
     {
! if (p2[0] != ',')
! {
!    if (p2[0] == '\\')
! ++p2;
  #ifdef FEAT_MBYTE
!    to = (*mb_ptr2char)(p2);
  #else
!    to = p2[0];
  #endif
+ }
     }
     if (to == NUL)
     {
***************
*** 10476,10490 ****
 
     /* Advance to next pair */
     mb_ptr_adv(p);
!    if (p2 == NULL)
!    {
! if (p[0] == ',')
! {
!    ++p;
!    break;
! }
!    }
!    else
     {
  mb_ptr_adv(p2);
  if (*p == ';')
--- 10488,10494 ----
 
     /* Advance to next pair */
     mb_ptr_adv(p);
!    if (p2 != NULL)
     {
  mb_ptr_adv(p2);
  if (*p == ';')
*** ../vim-7.2.425/src/version.c 2010-05-14 15:42:49.000000000 +0200
--- src/version.c 2010-05-14 17:32:11.000000000 +0200
***************
*** 683,684 ****
--- 683,686 ----
  {   /* Add new patch number below this line */
+ /**/
+     426,
  /**/

--
On the other hand, you have different fingers.
                                      -- Steven Wright

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Patch 7.2.426

Valery Kondakoff
On Fri, May 14, 2010 at 7:33 PM, Bram Moolenaar <[hidden email]> wrote:
> Patch 7.2.426
> Problem:    Commas in 'langmap' are not always handled correctly.
> Solution:   Require commas to be backslash escaped. (James Vega)
> Files:      src/option.c

Hmm... Something wrong here. Now, if I'm adding this: 'set
langmap=a\,' to my _vimrc I'm receiving an error: 'Error detected
while processing d:\tools\vim_vimrc:  line 16: E357: 'langmap':
Matching character missing for <0431>'.

I'm receiving an error E357 'Matching character missing for a' if I
execute ':set langmap=a\,' form command line.

The same langmap and command were working well in gVim 7.2.267. Now
there is an error in gVim 7.2.441 (Win7).

--
Best regards,
Valery Kondakoff

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Patch 7.2.426

Valery Kondakoff
On Tue, Jun 15, 2010 at 3:47 PM, Valery Kondakoff <[hidden email]> wrote:
>> Patch 7.2.426
>> Problem:    Commas in 'langmap' are not always handled correctly.
>> Solution:   Require commas to be backslash escaped. (James Vega)
>> Files:      src/option.c

> I'm receiving an error E357 'Matching character missing for a' if I
> execute ':set langmap=a\,' form command line.

Seems to work well like this: :set langmap=a\\,'. Is this a bug?

--
Best regards,
Valery Kondakoff

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Patch 7.2.426

Andy Wokula
Am 15.06.2010 13:53, schrieb Valery Kondakoff:

> On Tue, Jun 15, 2010 at 3:47 PM, Valery Kondakoff<[hidden email]>  wrote:
>>> Patch 7.2.426
>>> Problem:    Commas in 'langmap' are not always handled correctly.
>>> Solution:   Require commas to be backslash escaped. (James Vega)
>>> Files:      src/option.c
>
>> I'm receiving an error E357 'Matching character missing for a' if I
>> execute ':set langmap=a\,' form command line.
>
> Seems to work well like this: :set langmap=a\\,'. Is this a bug?

No.

:h option-backslash

--
Andy

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Patch 7.2.426

Valery Kondakoff
On Tue, Jun 15, 2010 at 4:01 PM, Andy Wokula <[hidden email]> wrote:
> Am 15.06.2010 13:53, schrieb Valery Kondakoff:
>>> I'm receiving an error E357 'Matching character missing for a' if I
>>> execute ':set langmap=a\,' form command line.
>> Seems to work well like this: :set langmap=a\\,'. Is this a bug?
>
> No.
> :h option-backslash

I understand, that if I want to enter a backslash in settings it
should be escaped by another backslash. But currently I'm using
backslash to escape the comma. Why should I enter two backslashes?

:help 'langmap'

"Special characters need to be preceded with a backslash.  These are
        ";", ',' and backslash itself.".

At least, escaping of ";" works well without double backslashes (like
this: '\;').

BTW: gVim 7.2.441 complains about not escaping the double quotes (")
as well. Should this be added to the langmap docs?

--
Best regards,
Valery Kondakoff

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Patch 7.2.426

James Vega-3
On Tue, Jun 15, 2010 at 8:20 AM, Valery Kondakoff <[hidden email]> wrote:

> On Tue, Jun 15, 2010 at 4:01 PM, Andy Wokula <[hidden email]> wrote:
>> Am 15.06.2010 13:53, schrieb Valery Kondakoff:
>>>> I'm receiving an error E357 'Matching character missing for a' if I
>>>> execute ':set langmap=a\,' form command line.
>>> Seems to work well like this: :set langmap=a\\,'. Is this a bug?
>>
>> No.
>> :h option-backslash
>
> I understand, that if I want to enter a backslash in settings it
> should be escaped by another backslash. But currently I'm using
> backslash to escape the comma. Why should I enter two backslashes?

Right, and in order for that backslash to be part of the option string
so that parsing of the option will see the backslash, you need to escape
it.  It's not a matter of escaping the comma on the command-line (since
that doesn't matter).  It's a matter of having a backslash in the
resulting string that's used for the option so that the option itself
has a backslash before the comma.

That is, if you simply do ":set langmap=a\," then after the command-line
is parsed you get ":set langmap=a,".  The comma isn't escaped.  When you
do ":set langmap=a\\,", then the backslash still exists after the
command-line is parsed and then when the option parsing takes place it
will see ":set langmap=a\," and you have an escaped comma.

--
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega <[hidden email]>

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Patch 7.2.426

Valery Kondakoff
On Tue, Jun 15, 2010 at 5:55 PM, James Vega <[hidden email]> wrote:
> That is, if you simply do ":set langmap=a\," then after the command-line
> is parsed you get ":set langmap=a,".  The comma isn't escaped.  When you
> do ":set langmap=a\\,", then the backslash still exists after the
> command-line is parsed and then when the option parsing takes place it
> will see ":set langmap=a\," and you have an escaped comma.

OK, thank you for explanation, have changed my langmap like this:

set langmap=ёйцукенгшщзхъфывапролджэячсмитьбюЙЦУКЕHГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ;`qwertyuiop[]asdfghjkl\\;'zxcvbnm\\,.QWERTYUIOP{}ASDFGHJKL:\\"ZXCVBNM<>


--
Best regards,
Valery Kondakoff

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php