Am 13.05.2018 um 20:53 schrieb Max Christian Pohle (Vim Github Repository):
In my .vimrc I do not want to have UTF-8 chars if possible, but
working with numeric representations of those isn't that comfortable
either. For that reason I tried to use Vims conceal feature to replace
nr2char(0xE0B4) and alike with a single character.

In an attempt I used a regex submatch:

|:call matchadd('Conceal', 'nr2char(\(0x[0-9A-Fa-f]*\))', 0, -1, {'conceal': 
nr2char("\1")})|

This cannot work, because `nr2char("\1")` (with backref) is evaluated
*now*, not when doing the match.

Help says the 'conceal' value should be a character.  It doesn't say you
can have an expression in there.

If it was possible, it would look like (akin :h sub-replace-\= )
    {'conceal': '\=nr2char(submatch(1))'}

Pattern Hint: the shortcut for `[0-9A-Fa-f]' is `\x'.

This caused a SEGFAULT (and sometimes 'strange' results). I imagine
that 'matchadd' must share some code with substitute(), but that
should either not lead to crash and work as expected or the expression
for conceal cursors should be automatically escaped or something like
that.

Sorry for not creating a bugfix, but the conceal feature is relatively
new to me.


--
Andy

--
--
You received this message from the "vim_dev" 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

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to