[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Display hide a char ?
- To: Nadim Shaikli <shaikli at yahoo dot com>
- Subject: Re: Display hide a char ?
- From: Bram Moolenaar <Bram at moolenaar dot net>
- Date: Thu, 07 Mar 2002 19:45:57 +0100
- Cc: vim-dev at vim dot org
- Cc: developer at arabeyes dot org
Nadim Shaikli wrote:
> > It sounds similar to what is done for composing characters. You might
> > want to look into that code. This means moving the "B" to become a
> > composing character of "A", which together form "C". Then the code that
> > knows about this is restricted to where composing characters are
> > handled.
>
> Its not at all similar in the sense that we are not asked to superimpose
> those two glyphs (which is what composing characters tend to do). So the
> idea is somewhat similar conceptually, but the execution of it is far from
> being the same. The 'C' in question is a completely different glyph in
> its own right (again this is only to be done on display). If I'm jumping
> to conclusions, do let me know.
It's the same in the sense that two characters are put in the space of
one character. It's not too difficult to replace the glyph in the
functions that handle displaying composing characters.
What might complicate the matter is that the current checks for
composing characters only need to check the character itself. For
replacing "AB" with "C" you also need to check the character before "B"
to decide that "B" is not to be displayed as a second character.
> OK, let's simplify this and remove the "arabic" notion from any of this.
>
> Let's assume I want to do the following,
>
> user enters -> "WXYZ"
> user sees -> "WYZ" (note, no X)
>
> certainly that's doable in vim (dynamically, ie. no replace post fact - the
> 'X' should simply not be shown and no keyboard/keymap tricks either, I'm
> looking for a vim code solution for this). What happens now is (with some
> hacking),
>
> now in vim -> "W YZ" (note, space)
>
> How can I (without touching cell-widths) tell VIM to not display that
> space ? This would certainly come in handy for other things as well
> (in case anyone wants to embed visually hidden characters for some
> reason, either for formatting or something else -- in other words, this
> would be a useful feature to have VIM support in general, no ?).
The only code that comes close to this is the handling for composing
characters.
I don't think that letting away characters is a useful generic feature.
Only for arabic does it appear to be useful.
--
hundred-and-one symptoms of being an internet addict:
179. You wonder why your household garbage can doesn't have an
"empty recycle bin" button.
/// Bram Moolenaar -- Bram at moolenaar dot net -- http://www.moolenaar.net \\\
/// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\
\\\ Project leader for A-A-P -- http://www.a-a-p.org ///
\\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///