Hello!
I have quite a few text files that is mixed with English and non-English
chars such as Chinese. Usually they are documents that have very long
lines that every line is a paragraph per se. So I use "set wrap". For
English text, I prefer "set linebreak" so that a word would not break at
the end of the screen line end. But VIM doens't work as I expected by
breaking the line at chars specified in "breakat", especially when with
Chinese text where a character is a word on its own. For example:
set linebreak
set wrap
now I have this text in a long line (I'll use X to represent a single
Chinese char in case you can't display it.)
English begins. English ends. Chinese begins.XXXXXXXXX.
Then I resize the window a bit narrower. This line should wrap like:
English begins. English ends. Chinese begins.XXXXX
XXXX.
This is because each Chinese char is a word on its own. I expect VIM to
break at Chinese chars as well as "breakat". But actually VIM wraps it
like:
English begins. English ends. Chinese begins.
XXXXXXXXX.
Although there are still enough space to display some Chinese chars
after the period sign "." in the first line.
Is there any mean that I can do to make VIM work as I expect?
Thank you!
Yao G. Zhan wrote:
> I have quite a few text files that is mixed with English and non-English
> chars such as Chinese. Usually they are documents that have very long
> lines that every line is a paragraph per se. So I use "set wrap". For
> English text, I prefer "set linebreak" so that a word would not break at
> the end of the screen line end. But VIM doens't work as I expected by
> breaking the line at chars specified in "breakat", especially when with
> Chinese text where a character is a word on its own. For example:
>
> set linebreak
> set wrap
>
> now I have this text in a long line (I'll use X to represent a single
> Chinese char in case you can't display it.)
>
> English begins. English ends. Chinese begins.XXXXXXXXX.
>
> Then I resize the window a bit narrower. This line should wrap like:
>
> English begins. English ends. Chinese begins.XXXXX
> XXXX.
>
> This is because each Chinese char is a word on its own. I expect VIM to
> break at Chinese chars as well as "breakat". But actually VIM wraps it
> like:
>
> English begins. English ends. Chinese begins.
> XXXXXXXXX.
>
> Although there are still enough space to display some Chinese chars
> after the period sign "." in the first line.
>
> Is there any mean that I can do to make VIM work as I expect?
I understand the problem. 'breakat' is a list of characters, thus it
doesn't allow a regexp or character range. Adding all Chinese
characters to it would make it much too long.
Perhaps we could allow character ranges. But previously something like
"[a-z]" would mean the characters "][az-". Perhaps doubling the square
brackets isn't too bad: "[[a-z]]"? Otherwise a separate option could be
used.
Anyway, using a regexp here will certainly slow down processing.
Currently a 256-entry lookup table is used to speedup processing. That
won't work for multi-byte characters...
--
Nobody will ever need more than 640 kB RAM.
-- Bill Gates, 1983
Windows 98 requires 16 MB RAM.
-- Bill Gates, 1999
Logical conclusion: Nobody will ever need Windows 98.
/// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
/// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ Project leader for A-A-P -- http://www.A-A-P.org ///
\\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///
Hi Bram,
Bram Moolenaar wrote:
> Anyway, using a regexp here will certainly slow down processing.
> Currently a 256-entry lookup table is used to speedup processing. That
> won't work for multi-byte characters...
Do you keep the unicode charater properties in memory somewhere? In
that case you might want to consider doing a lookup in that table
instead. Actually, I believe that that's the only "right" solution that
would work reasonably correctly under any language.
Regards,
Camillo
--
Camillo Srs <ged@...> Aim for the impossible and you
http://camillo.srs.net will achieve the improbable
Camillo Srs wrote:
> Bram Moolenaar wrote:
> > Anyway, using a regexp here will certainly slow down processing.
> > Currently a 256-entry lookup table is used to speedup processing. That
> > won't work for multi-byte characters...
>
> Do you keep the unicode charater properties in memory somewhere? In
> that case you might want to consider doing a lookup in that table
> instead. Actually, I believe that that's the only "right" solution that
> would work reasonably correctly under any language.
There are a few properties of Unicode characters that Vim knows, such as
the cell width and upper/lower case. But that a sequence of characters
can be wrapped at any point isn't in there. The rough separation in
latin1 and non-latin1 characters is sufficient for when mixing Asian
text with English. Perhaps that's sufficient for most people.
--
hundred-and-one symptoms of being an internet addict:
120. You ask a friend, "What's that big shiny thing?" He says, "It's the sun."
/// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
/// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ Project leader for A-A-P -- http://www.A-A-P.org ///
\\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///
I have no idea why yahoo mail refuses to let me send a letter to my
daughter.Can you help me avoid this problem in the future? And why
can't I send a normal letter? there is no foul language,sex,threats
etc. in it. thanks,twillie
Hi. This is the qmail-send program at yahoo.com.
I'm afraid I wasn't able to deliver your message to the following
addresses.
This is a permanent error; I've given up. Sorry it didn't work out.
<cwalton1@...>:
131.156.1.15 failed after I sent the message.
Remote host said: 554 5.7.1 Message scored too high on spam scale.
For help,
please quote incident ID 2605141.
<z067870@...>:
131.156.1.15 failed after I sent the message.
Remote host said: 554 5.7.1 Message rejected because of unacceptable
content
(SpamScore). For help, please quote incident ID 2605141.
--- Below this line is a copy of the message.
Return-Path: <twilliams_63@...>
Received: (qmail 84825 invoked by uid 60001); 5 Sep 2005 04:57:56 -
0000
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
The Vim website has been quite slow lately. This was mostly caused by
the MySQL server being heavily loaded.
I have now setup caching for the index page. This information doesn't
change that often, thus doing a database query every time isn't really
needed. The page is now updated every ten minutes.
Hopefully the only thing you notice is the fast loading. If you spot
another problem, let me know.
--
If Microsoft would build a car...
... You'd have to press the "Start" button to turn the engine off.
/// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
/// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ Project leader for A-A-P -- http://www.A-A-P.org ///
\\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///
This message is about Vim's charity, not about Vim itself. If you are
not interested, please just skip it. Flame me if you want...
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
In October I am going to visit the Kibaale Children's Centre in Uganda.
Communication with the project has always been difficult, because they
are in a remote area. Last year I managed to setup a GSM antenna so
that they could be called.
I have now heard that the phone broke down. I don't know why or if they
can get it fixed. But at least I want to bring another phone on my
trip, either as a replacement or as a backup. I also want to setup
e-mail, because this is the most convenient method and has much lower
cost.
For this purpose I'm looking for a second hand phone. Hopefully someone
has one laying around because he got a new one. The phone may be
scratched and look ugly, so long as it works properly.
I can't use just any phone, because it needs to be connected to a GSM
antenna and to a computer. The cables for this are hard to get and/or
expensive.
The preferred models are Nokia 5110/6110/7110/6210/6310. These all use
the same cables and have an antenna connector on the back (usually
covered by a round rubber plug). For these I can easily get cables that
I know will work (I used a Nokia 7110 last year). Thus I can use these
even if you don't have the cables.
For other models I would need a complete set:
- Phone with internal modem
- Antenna cable (adapter) which fits an FME plug. Note that signal
strength matters, thus it should be a good cable, not an inductive
coupled one.
- PC cable to USB, with software that supports using the phone as a modem.
If you are in Europe you can send it directly to me:
Bram Moolenaar
Clematisstraat 30
5925 BE Venlo
The Netherlands
When outside of Europe we need to be aware of taxes. If you can clearly
mark the package as something up to $20 it should be OK. If it goes
over that I have to pay taxes (also over the transport costs), this may
make it unattractive.
I'm packing my bags October 15, thus it should be here before then.
Sooner is better, so that I can try it out before leaving. In case of
any doubt, please ask me before sending anything.
Here you can read the report of my trip last year, with a picture of the
GSM antenna I setup then: http://iccf-holland.org/news.html
--
hundred-and-one symptoms of being an internet addict:
244. You use more than 20 passwords.
/// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
/// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ Project leader for A-A-P -- http://www.A-A-P.org ///
\\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///
Rainux wrote:
> I'm sorry for some personal reason I've left some days.
>
> > {
> > char *ts =3D _("%ld more lines");
> > sprintf((char *)msg_buf, ts, pn);
> > }
> >
> > If it now crashes in sprintf() then it's a different problem. But from
> > your description it should crash in _().
>
> I did this, and it crash in sprintf(), seems the problem is in msvcrt.dll.
>
> I use Borland C++ 5.5.1 for Win32 compile Vim just now(previously I
> use Cygwin's gcc), and found the new gvim.exe's import table don't
> have msvcrt.dll. And, this build of gvim never crashes in zh_CN.UTF-8.
> So I think the problem should in msvcrt.dll(Bram use MSVC compile Vim,
> so the "official build" rely on msvcrt.dll).
The problem may be that there is a % character in the second byte of one
of the Chinese double-byte characters. sprintf() then may see the wrong
arguments.
Another possibility is that msg_buf is too small. I made it longer a
short while ago. Currently it's 480 bytes. In Vim 6.3 the value was
80. Patch 6.3.072 changed it to 240. If you are still using 80 then
this is probably the cause of the trouble.
--
"Hegel was right when he said that we learn from history that man can
never learn anything from history." (George Bernard Shaw)
/// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
/// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ Project leader for A-A-P -- http://www.A-A-P.org ///
\\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///