Re: [Suggestion] New functions iskeywordchar(), isfnamechar(), isprintchar(), and isidentchar()

2011-11-08 Thread Andy Wokula
Am 07.11.2011 15:08, schrieb Axel Bender: @Andy Thanks for the answer! The split on '\zs' was new to me. Made some speed tests and found that for lines with more than 180 chars the first solution is faster, and for shorter lines the solution below, which is based on the split() approach.

Re: [Suggestion] New functions iskeywordchar(), isfnamechar(), isprintchar(), and isidentchar()

2011-11-08 Thread Axel Bender
@Andy thanks for the input! However - knowing about escape(cword) - I don't want to use it because it for the reasons given in one of my previous posts (e.g. ~ always returns a value and thus hides the info I need). Thanks again! -- You received this message from the vim_use maillist. Do

Re: [Suggestion] New functions iskeywordchar(), isfnamechar(), isprintchar(), and isidentchar()

2011-11-07 Thread Axel Bender
@Tim The answer I found (cmp. above) is my replacement for escape(cword), which I didn't find helpful in all situations. I wanted to include fewer/more characters in vim's notion of what a cword is, and I wanted to be able to define a left boundary different from the right one. Adding to

Re: [Suggestion] New functions iskeywordchar(), isfnamechar(), isprintchar(), and isidentchar()

2011-11-07 Thread Andy Wokula
Am 06.11.2011 20:22, schrieb Axel Bender: Thanks for the replies! The problem however isn't solved... Having obtained the current byte index using col(.), I can't simply add n to/subtract n from the return value of col(.) to find the beginning of the next/previous multi-byte character (the -1

Re: [Suggestion] New functions iskeywordchar(), isfnamechar(), isprintchar(), and isidentchar()

2011-11-07 Thread Axel Bender
@Andy Thanks for the answer! The split on '\zs' was new to me. Made some speed tests and found that for lines with more than 180 chars the first solution is faster, and for shorter lines the solution below, which is based on the split() approach. Opted for the new solution as short lines

Re: [Suggestion] New functions iskeywordchar(), isfnamechar(), isprintchar(), and isidentchar()

2011-11-06 Thread Axel Bender
Thanks for the replies! The problem however isn't solved... Having obtained the current byte index using col(.), I can't simply add n to/subtract n from the return value of col(.) to find the beginning of the next/previous multi-byte character (the -1 offset is ok because there's a base

Re: [Suggestion] New functions iskeywordchar(), isfnamechar(), isprintchar(), and isidentchar()

2011-11-06 Thread Axel Bender
Addendum. Heureka, I've found it! The solution is based on a combination of virtcol(.) and byteidx(...): function! CWord(string, class_start, class_end) let l:len = len(substitute(a:string, ., x, g)) let l:pos = virtcol(.) - 1 let l:start = l:pos while l:start = 0

Re: [Suggestion] New functions iskeywordchar(), isfnamechar(), isprintchar(), and isidentchar()

2011-11-06 Thread Tim Chase
On 11/06/11 13:22, Axel Bender wrote: Having obtained the current byte index using col(.), I can't simply add n to/subtract n from the return value of col(.) to find the beginning of the next/previous multi-byte character (the -1 offset is ok because there's a base bias). I could use col(.)

Re: [Suggestion] New functions iskeywordchar(), isfnamechar(), isprintchar(), and isidentchar()

2011-11-04 Thread Axel Bender
Addendum: Is there a UTF-8-safe version? The following doesn't work for a UTF-8 file (both enc and fenc): :echo getline(.)[col(.) ] =~ '\k' when over an ü (i.e. an character that - if in Latin-1 - would be in the default iskeyword option range). Note: The inspected character is the *second*

Re: [Suggestion] New functions iskeywordchar(), isfnamechar(), isprintchar(), and isidentchar()

2011-11-04 Thread Andy Wokula
Am 04.11.2011 16:43, schrieb Axel Bender: Addendum: Is there a UTF-8-safe version? The following doesn't work for a UTF-8 file (both enc and fenc): :echo getline(.)[col(.) ] =~ '\k' when over an ü (i.e. an character that - if in Latin-1 - would be in the default iskeyword option range).

[Suggestion] New functions iskeywordchar(), isfnamechar(), isprintchar(), and isidentchar()

2011-11-03 Thread Axel Bender
Sometimes it's necessary to determine whether a given character belongs to one of the options whose names are reflected by the above (suggested) function names. Though it's possible to write those functions in vim itself, one would either have to call such a function manually a) after a change

Re: [Suggestion] New functions iskeywordchar(), isfnamechar(), isprintchar(), and isidentchar()

2011-11-03 Thread Andy Wokula
Am 03.11.2011 19:07, schrieb Axel Bender: Sometimes it's necessary to determine whether a given character belongs to one of the options whose names are reflected by the above (suggested) function names. Though it's possible to write those functions in vim itself, one would either have to call

Re: [Suggestion] New functions iskeywordchar(), isfnamechar(), isprintchar(), and isidentchar()

2011-11-03 Thread Tim Chase
On 11/03/11 13:07, Axel Bender wrote: Sometimes it's necessary to determine whether a given character belongs to one of the options whose names are reflected by the above (suggested) function names. Though it's possible to write those functions in vim itself, one would either have to call such a

Re: [Suggestion] New functions iskeywordchar(), isfnamechar(), isprintchar(), and isidentchar()

2011-11-03 Thread Axel Bender
@Andy, Tim thanks! Sometimes one doesn't see the forrest for the trees. -- You received this message from the vim_use 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