Thursday, November 3, 2011

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

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 such a function "manually" a) after a
> change to the respective option value (e.g. set iskeyword+=#), or b) before
> every check for containedness in the option value.
>
> As vim tracks the option values internally, it should be no big deal to
> provide such functions.
>
> Comments?

iskeywordchar(char) is-the-same-as char =~ '\k'
isfnamechar(char) is-the-same-as char =~ '\f'
isprintchar(char) is-the-same-as char =~ '\p'
isidentchar(char) is-the-same-as char =~ '\i'

Or think of "is-the-same-as" as "would-be-the-same-as".

There is no need for such functions, imho.

--
Andy

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

No comments: