Vim 7.3.1000
ftp.vim.org
ftp.vim.org
I don't know Bram, but I can't help but wonder why such a distinguished open source figure has ultimately ended up working for Google. Maybe he enjoys the access to resources. I wish donations could still support him directly rather than his idea of aid (well it does seem to have a bend towards education at least). I wish he wouldn't need a day job and could yet breed other new and great contributions to the world. I don't feel particularly endeared towards Google, despite all the collateral good it has done while doing a lot of evil (i.e. something to do with the looming ad empire strengthening big corporations.)
Screenshot of relevant text: http://i.imgur.com/xMnHDg4.png
Basically certain Hebrew characters have descenders which can overlap with diatric marks in the next line of text. These variations are suitable replacements that alter it slightly so it won't overlap.
#define HEBREW_CHAR_MIN 0xfb20
#define HEBREW_CHAR_MAX 0xfb4f
(Probably with even more descriptive names, but I don't know the problem domain.)enum { HebrewCharMin=0xfb20, HebrewCharMax=0xfb4f, };
On the other hand, I'm really a C++ guy, and in that domain, I'd prefer your "const uint32_t" solution. It just feels more idiomatic.
Additionally and somewhat pedantically, I prefer naming conventions that make it clear when values are a constant, so I'd use "kHebrewCharMin" or something simliar.
The other thing is that function signatures can now show 'enum myenum e' instead of 'int v', which is much clearer.
But here, the values /don't/ form a closed set, and using enums would imply that they do.
Note: in C++, global/static const values do behave as compile time constant expressions and are an excellent tool for this purpose.
EDIT: Oh, I guess that doesn't work in gvim?
Also, sometimes you don't want to wait for something. `bundle install` can take a good 30 seconds...I'd rather not watch that!
Most people here would read 0xFF0000 and automatically think "red".
But I agree that in this case a define would have helped.
:h two-engines
:h 're'
This is an interesting snippet from that code...:
/* decompose the character if necessary, into 'base' characters
* because I don't care about Arabic, I will hard-code the Hebrew
* which I *do* care about! So sue me... */
if (c1 != c2 && (!ireg_ic || utf_fold(c1) != utf_fold(c2)))
{
/* decomposition necessary? */
mb_decompose(c1, &c11, &junk, &junk);
mb_decompose(c2, &c12, &junk, &junk);
c1 = c11;
c2 = c12;
if (c11 != c12 && (!ireg_ic || utf_fold(c11) != utf_fold(c12)))
break;
}
Apparently string comparison is harder than I previously thought.Fortunately, there are ICU bindings for every non-toy language which solves these sorts of problems for you (although ICU has the drawback of being absolutely huge).
I guess the ICU stuff probably gives you an strtol equivalent that can handle that sort of stuff.
Anyone know if this is true?
Disclaimer: I love all 3 editors for they all have great ideas.
Some information is available in the "Plans for Vim 7.4" thread in the vim_dev group: https://groups.google.com/forum/?fromgroups#!topic/vim_dev/Z...