driusan / de

A Programmer's Text Editor
MIT License
428 stars 26 forks source link

do we want to try symbol replacement in rendering plugins? #31

Open josephholsten opened 8 years ago

josephholsten commented 8 years ago

for example, vim-pandoc-syntax uses the following symbols instead of the raw markdown text:

    let s:cchars = { 
        \"newline": "↵", 
        \"image": "▨", 
        \"super": "ⁿ", 
        \"sub": "ₙ", 
        \"strike": "x̶", 
        \"atx": "§",  
        \"codelang": "λ",
        \"codeend": "—",
        \"abbrev": "→",
        \"footnote": "†",
        \"definition": " ",
        \"li": "•",
                \"html_c_s": "‹",
                \"html_c_e": "›"}
driusan commented 8 years ago

I foresee two problems with this:

  1. How do you edit a character in buffer the middle of a string that's getting mangled by the renderer?
  2. The image->character map already has a bug where it doesn't map multibyte unicode characters properly. This couldn't use the default imagemap, but would need to write its own imagemap, since using the default one would have similar issues.

That said, I don't have any issues with an alternative markdown renderer that you can switch to with the Renderer command which tries to do magic like this, I just think the default should be as faithful as it can be to the bytes in the text since if you're opening a file in an editor, it's probably because you want to edit it.