Bug: too wide unicode character ranges echo «Invalid range» error

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

Bug: too wide unicode character ranges echo «Invalid range» error

Nikolay Aleksandrovich Pavlov
I need to test whether character is in range [\u00A0-\uD7FF] (actual collection
has more items, see printable characters definition in YAML 1.2 RFC), but this
throws «Invalid range» error. After some experiments, I found that character
ranges that are wider then 0x100 also result in error:

    :echo ''=~'[\uD6FE-\uD7FF]'
    E16: Invalid range
    0
    :echo ''=~'[\uD6FF-\uD7FF]'
    0
    :echo ''=~'[\uD6FE-\uD7FE]'
    0

Tested on latest vim 7.3. This should be either fixed or at least mentioned in
documentation.

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Bug: too wide unicode character ranges echo «Invalid range» error

Bram Moolenaar

ZyX (?) wrote:

> I need to test whether character is in range [\u00A0-\uD7FF] (actual
> collection has more items, see printable characters definition in YAML
> 1.2 RFC), but this throws «Invalid range» error. After some
> experiments, I found that character ranges that are wider then 0x100
> also result in error:
>
>     :echo ''=~'[\uD6FE-\uD7FF]'
>     E16: Invalid range
>     0
>     :echo ''=~'[\uD6FF-\uD7FF]'
>     0
>     :echo ''=~'[\uD6FE-\uD7FE]'
>     0
>
> Tested on latest vim 7.3. This should be either fixed or at least
> mentioned in documentation.

It's a known limitation.  I thought it was mentioned somewhere, can't
find it now.  I'll add a comment.

--
   GALAHAD turns back.  We see from his POV the lovely ZOOT standing by him
   smiling enchantingly and a number of equally delectable GIRLIES draped
   around in the seductively poulticed room.  They look at him smilingly and
   wave.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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: Bug: too wide unicode character ranges echo «Invalid range» error

Tony Mechelynck
On 09/07/10 22:08, Bram Moolenaar wrote:

>
> ZyX (?) wrote:
>
>> I need to test whether character is in range [\u00A0-\uD7FF] (actual
>> collection has more items, see printable characters definition in YAML
>> 1.2 RFC), but this throws «Invalid range» error. After some
>> experiments, I found that character ranges that are wider then 0x100
>> also result in error:
>>
>>      :echo ''=~'[\uD6FE-\uD7FF]'
>>      E16: Invalid range
>>      0
>>      :echo ''=~'[\uD6FF-\uD7FF]'
>>      0
>>      :echo ''=~'[\uD6FE-\uD7FE]'
>>      0
>>
>> Tested on latest vim 7.3. This should be either fixed or at least
>> mentioned in documentation.
>
> It's a known limitation.  I thought it was mentioned somewhere, can't
> find it now.  I'll add a comment.
>

It has been discussed on the list (vim_dev? vim_multibyte?) some time
ago, and IIRC a [] range in a pattern can be at most 257 codepoints
long, but I can't find it back in the help.

Best regards,
Tony.
--
"What I've done, of course, is total garbage."
                -- R. Willard, Pure Math 430a

--
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