I am working on a plugin that draws.
I certainly can draw with characters such as:
'-', '|' and '+' which are supported by
all fonts. But, I'd like to do better for
those users that have fonts that support
the unicode box drawing characters. But, again,
how to tell if such a character will actually
be rendered.
Richard
On 05/17/2012 05:57 AM, Benjamin R. Haskell wrote:
On Wed, 16 May 2012, richard emberson wrote:
I am using a linux system with console Vim 7.3 in an xterm.
If I start the xterm with font 10x20, then if I enter
Cntl-V u 250C
I see BOX DRAWINGS LIGHT DOWN AND RIGHT character and entering 'ga'
shows that its there.
If I enter
Cntl-V u 2554
the BOX DRAWINGS DOUBLE DOWN AND RIGHT
does not show up, but entering 'ga' shows that its there.
On the other hand, if I start the xterm with font
'-misc-fixed-medium-r-normal-*-20-*-*-*-*-*-iso10646-*' then both
characters are displayed and using 'ga' shows them both just like
using the 10x20 font.
Clearly, the non-unicode font 10x20 does not support the extended BOX
DRAWINGS DOUBLE character and it does not get rendered.
Is there a way in Vim to tell if a character will actually be rendered
for the end viewer?
No, most(?)ลก terminal emulators don't have such a mechanism.
So, a script can know not to use that character.
I'm not sure what you mean here. Why would a script care? If a user
opens a file in terminal Vim and it contains characters that can't be
displayed, the user can just quit and open it in another editor that can
display the characters (another terminal with a different font, or some
GUI program). The user can also, as you reported, edit the file anyway
(Vim won't corrupt the data -- it just won't be displayed properly).
Otherwise, if it's not a file, why does Vim come into play?
Or, must the end user of the script always have to figure out that
they must set some configuration options to disable the use of such
characters?
Maybe a flag such as '--ascii' or '--no-unicode' to prevent the use of
"fancy" box drawing would be sufficient? `pstree`, for example, has
three modes:
-A|--ascii : ASCII characters
-G|--vt100 : VT-100 line drawing
-U|--unicode : Unicode box drawing characters
--
Quis custodiet ipsos custodes
--
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