Re: Questions about vim_iswordc() and vim_iswordp()

2016-12-12 Fir de Conversatie selzerolivia via vim_dev


On Mon, 12/12/16, Ozaki Kiichi <gclient.g...@gmail.com> wrote:

 Subject: Re: Questions about vim_iswordc() and vim_iswordp()
 To: "vim_dev" <vim_dev@googlegroups.com>
 Cc: gclient.g...@gmail.com
 Date: Monday, December 12, 2016, 11:59 PM
 
 > They should both
 respect 'iskeyword' for characters up to 255.
 > So it looks like vim_iswordp() needs to be
 fixed.
 > 
 
 Thank you. OK, my above patch has reflected
 this fix.
 
 -- 
 -- 
 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
 
 --- 
 You
 received this message because you are subscribed to the
 Google Groups "vim_dev" group.
 To
 unsubscribe from this group and stop receiving emails from
 it, send an email to vim_dev+unsubscr...@googlegroups.com.
 For more options, visit
 https://groups.google.com/d/optout.
 robleme indisolubil legate una de cealalta: echilibrul de putere in vestul 
Europei

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Questions about vim_iswordc() and vim_iswordp()

2016-12-12 Fir de Conversatie Ozaki Kiichi
> They should both respect 'iskeyword' for characters up to 255.
> So it looks like vim_iswordp() needs to be fixed.
> 

Thank you. OK, my above patch has reflected this fix.

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Questions about vim_iswordc() and vim_iswordp()

2016-12-12 Fir de Conversatie Bram Moolenaar

Ozaki Kiichi wrote:

> > when c == 0xA0, p == "\xC2\xA0", and 'iskeyword' includes 160
> > 
> > (e.g. iskeyword=@,48-57,_,128-167,224-235 (default on windows))
> > 
> > then: vim_iswordc(c) == 1, but vim_iswordp(p) == 0.
> 
> After all, in the above case, should vim_iswordc(c) and vim_iswordp(p) be
> whether TRUE or FALSE?

They should both respect 'iskeyword' for characters up to 255.
So it looks like vim_iswordp() needs to be fixed.

-- 
hundred-and-one symptoms of being an internet addict:
108. While reading a magazine, you look for the Zoom icon for a better
 look at a photograph.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Questions about vim_iswordc() and vim_iswordp()

2016-12-12 Fir de Conversatie Ozaki Kiichi
> when c == 0xA0, p == "\xC2\xA0", and 'iskeyword' includes 160
> 
> (e.g. iskeyword=@,48-57,_,128-167,224-235 (default on windows))
> 
> then: vim_iswordc(c) == 1, but vim_iswordp(p) == 0.

After all, in the above case, should vim_iswordc(c) and vim_iswordp(p) be
whether TRUE or FALSE?

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Questions about vim_iswordc() and vim_iswordp()

2016-12-11 Fir de Conversatie ouidacisneros via vim_dev


On Sun, 12/11/16, Ozaki Kiichi <gclient.g...@gmail.com> wrote:

 Subject: Re: Questions about vim_iswordc() and vim_iswordp()
 To: "vim_dev" <vim_dev@googlegroups.com>
 Date: Sunday, December 11, 2016, 11:06 PM
 
 I updated patch.
 
 https://gist.github.com/ichizok/1be6efa8364777cf167003e2c5676d8f
 
 (This assumes [1], [2] is
 correct)
 
 *
 vim_iswordp_buf() uses vim_iswordc_buf() directly
 * add kword_test to test the results of
 vim_iswordc and vim_iswordp are
 matched, in
 case the of enc=utf-8 and 0 <= c < 0x1
 
 -- 
 -- 
 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
 
 --- 
 You
 received this message because you are subscribed to the
 Google Groups "vim_dev" group.
 To
 unsubscribe from this group and stop receiving emails from
 it, send an email to vim_dev+unsubscr...@googlegroups.com.
 For more options, visit
 https://groups.google.com/d/optout.
 a 17 februarie 1859 consulul francez la Bucuresti  BSclard  raporta la Paris: 
Noul domnitor  cu fata sa placuta  aspectul sau tineresc: expresia calma si 
hotarata a fizionomiei sale incanta multimea  care il privea sarbatoreste si se 
imbulzea in urma sa... Colonelul Cuza are  din ceea ce cred eu  una dintre 
calitatile cele mai rare si in consecinta cea mai pretioasa in aceasta tara  
sinceritatea. Am gasit la el de asemenea bunul simt si modestia... Ar fi omul 
nou pe care il cere situatia sa noua... 

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Questions about vim_iswordc() and vim_iswordp()

2016-12-11 Fir de Conversatie Ozaki Kiichi
I updated patch.

https://gist.github.com/ichizok/1be6efa8364777cf167003e2c5676d8f

(This assumes [1], [2] is correct)

* vim_iswordp_buf() uses vim_iswordc_buf() directly
* add kword_test to test the results of vim_iswordc and vim_iswordp are
matched, in case the of enc=utf-8 and 0 <= c < 0x1

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Questions about vim_iswordc() and vim_iswordp()

2016-12-09 Fir de Conversatie Ozaki Kiichi
> Thanks for looking into this.  The patch seems to be missing a change to
> mbyte.c.  mb_get_class_buf() needs to be adjusted to use
> vim_iswordc_buf() when the character is below 256.

I'm sorry for confusing you, this patch is for only [3].
(It was unclear for me whether [1],[2] is correct or not.)
 
> We also should have a test for this.
> 
> 
> -- 
> % cat /usr/include/life.h
> void life(void);
> 
>  /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
> ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
> \\\  an exciting new programming language -- http://www.Zimbu.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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Questions about vim_iswordc() and vim_iswordp()

2016-12-09 Fir de Conversatie Bram Moolenaar

Ozaki Kiichi wrote:

> I have some questions about vim_iswordc() and vim_iswordp().
> 
> [1] I recognize that we can use unicode character as an argument of
> vim_iswordc (and vim_iswordc_buf).
> If so, I think that the following must be satisfied; Is this correct?
> 
> premise:
> 
> * 'encoding' is utf8
> * "c" is int, unicode character (U+)
> * "p" is (char_u *), utf8 sequence of "c"
> 
> (e.g. c == 0x100 <=> p == "\xC4\x80")
> 
> then: vim_iswordc(c) == vim_iswordp(p) is TRUE
> 
> 
> [2] If [1] is correct, it is a problem that there is a character such that
> vim_iswordc(c) != vim_iswordp(p) with specific 'iskeyword'.
> 
> when c == 0xA0, p == "\xC2\xA0", and 'iskeyword' includes 160
> 
> (e.g. iskeyword=@,48-57,_,128-167,224-235 (default on windows))
> 
> then: vim_iswordc(c) == 1, but vim_iswordp(p) == 0.
> 
> bacause: 
> 
> In vim_iswordc_buf();
> 
> https://github.com/vim/vim/blob/342156637/src/charset.c#L911
> 
> c == 0xA0 < 0x100
> 
> https://github.com/vim/vim/blob/342156637/src/charset.c#L911
> 
> c > 0 and c < 0x100, and c is in buf->b_chartab
> (GET_CHARTAB(buf, c) != 0).
> 
> Thus, vim_iswordc_buf(c, buf) is TRUE.
> 
> In vim_iswordp_buf();
> 
> https://github.com/vim/vim/blob/342156637/src/charset.c#L921
> 
> has_mbyte is TRUE and MB_BYTE2LEN(*p) == 2. (*p == 0xC2)
> 
> https://github.com/vim/vim/blob/342156637/src/charset.c#L922
> https://github.com/vim/vim/blob/342156637/src/mbyte.c#L898
> 
> calls mb_get_class(p) -> utf_class(utf_ptr2char(p)).
> utf_ptr2char(p) == 0xA0, is equal to c, so utf_class(0xA0).
> 
> https://github.com/vim/vim/blob/342156637/src/mbyte.c#L2781
> 
> c < 0x100 and c == 0xa0, then return 0.
> 
> Thus, vim_iswordp_buf(p, buf) is FALSE.
> 
> 
> [3] This is not mush to do with above;
> 
> It appears that
> * vim_iswordp_buf() should use mb_get_class_buf()
> * vim_iswordp() should return vim_iswordp_buf(p, curbuf)
> 
> https://gist.github.com/ichizok/1be6efa8364777cf167003e2c5676d8f

Thanks for looking into this.  The patch seems to be missing a change to
mbyte.c.  mb_get_class_buf() needs to be adjusted to use
vim_iswordc_buf() when the character is below 256.

We also should have a test for this.


-- 
% cat /usr/include/life.h
void life(void);

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.