Loading ...
Sorry, an error occurred while loading the content.

Re: strikethrough text in gvim

Expand Messages
  • Christian Brabandt
    ... This sounds like an interesting idea and I thought, it would be fun, to check how easy it would be to implement it. Attached is a patch to try out. It
    Message 1 of 4 , Jul 30 12:56 PM
    • 0 Attachment
      On Mi, 24 Jul 2013, Jeroen Budts wrote:

      > I have a feature request for gvim, I'm not sure if I should ask it
      > here or on the dev list?
      > Would it be possible to add support for strikethrough text in Gvim?
      > Since gvim can already display bold, italic, underline and undercurl
      > text I guess it can't be too difficult to add this to gvim?
      >
      > Strikethrough text would be useful in multiple occasions imho. For
      > example in Vimwiki you can add ~~some text~~ which will be rendered
      > to html as strikethrough, so it would be nice if gvim could actually
      > show it as strikethrough (exactly the same as currently for *bold*
      > and _italic_ text in vimwiki).
      > Or for example to clearly indicate removed text when viewing a diff.
      >
      > Jeroen

      This sounds like an interesting idea and I thought, it would be fun, to
      check how easy it would be to implement it.

      Attached is a patch to try out. It seems to work for me with GTK and
      Motif Gui. I am a Unix gui and can't say for sure the code for Windows
      and Mac is actually correct and works, though.

      Secondly, I am unsure about the changes to term.c and term.h
      I don't know, if these changes are actually needed, so I simply took the
      undercurl code as an example and changed it so it would fit for
      strikethrough.

      regards,
      Christian

      --
      --
      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

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Ken Takata
      Hi Christian, ... I checked your patch on Windows. It works fine. ... i foo ... I think it is better to add term cap entries. Currently, termcap
      Message 2 of 4 , Oct 12, 2013
      • 0 Attachment
        Hi Christian,

        2013/07/31 Wed 4:56:39 UTC+9 Christian Brabandt wrote:
        > Attached is a patch to try out. It seems to work for me with GTK and
        > Motif Gui. I am a Unix gui and can't say for sure the code for Windows
        > and Mac is actually correct and works, though.

        I checked your patch on Windows. It works fine.
        I checked it with the following process:

        > gvim -N foo.html
        :syn enable
        :syn region htmlStrike start="<del\>" end="</del>"me=e-6 contains=@htmlTop
        :hi def htmlStrike term=strikethrough cterm=strikethrough gui=strikethrough
        i<del>foo</del>


        > Secondly, I am unsure about the changes to term.c and term.h
        > I don't know, if these changes are actually needed, so I simply took the
        > undercurl code as an example and changed it so it would fit for
        > strikethrough.

        I think it is better to add term cap entries. Currently, termcap doesn't
        support strikethrough attributes, so we have to use our own attribute names.
        (E.g. 't_Ts'/'t_Te' or 't_SS'/'t_SE')
        I also think that a new flag (e.g. 't' or 'S') should be added in the
        'highlight' option.

        I and Hayaki Saito updated your patch to add them. After applying this patch
        and setting escape sequences properly,

        let &t_Ts="\e[9m"
        let &t_Te="\e[29m"

        some terminals (*) will show strikethrough lines.

        (*)
        RLogin: http://nanno.dip.jp/softlib/man/rlogin/ (Japanese)
        pangoterm: https://launchpad.net/pangoterm/

        Regards,
        Ken Takata

        --
        --
        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

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Christian Brabandt
        Hi Ken! ... Very nice, thanks! regards, Christian -- Wie man sein Kind nicht nennen sollte: Rod Ation -- -- You received this message from the vim_use
        Message 3 of 4 , Oct 19, 2013
        • 0 Attachment
          Hi Ken!

          On Sa, 12 Okt 2013, Ken Takata wrote:
          > 2013/07/31 Wed 4:56:39 UTC+9 Christian Brabandt wrote:
          > > Attached is a patch to try out. It seems to work for me with GTK and
          > > Motif Gui. I am a Unix gui and can't say for sure the code for Windows
          > > and Mac is actually correct and works, though.
          >
          > I checked your patch on Windows. It works fine.
          > I checked it with the following process:
          >
          > > gvim -N foo.html
          > :syn enable
          > :syn region htmlStrike start="<del\>" end="</del>"me=e-6 contains=@htmlTop
          > :hi def htmlStrike term=strikethrough cterm=strikethrough gui=strikethrough
          > i<del>foo</del>
          >
          >
          > > Secondly, I am unsure about the changes to term.c and term.h
          > > I don't know, if these changes are actually needed, so I simply took the
          > > undercurl code as an example and changed it so it would fit for
          > > strikethrough.
          >
          > I think it is better to add term cap entries. Currently, termcap doesn't
          > support strikethrough attributes, so we have to use our own attribute names.
          > (E.g. 't_Ts'/'t_Te' or 't_SS'/'t_SE')
          > I also think that a new flag (e.g. 't' or 'S') should be added in the
          > 'highlight' option.
          >
          > I and Hayaki Saito updated your patch to add them. After applying this patch
          > and setting escape sequences properly,
          >
          > let &t_Ts="\e[9m"
          > let &t_Te="\e[29m"
          >
          > some terminals (*) will show strikethrough lines.
          >
          > (*)
          > RLogin: http://nanno.dip.jp/softlib/man/rlogin/ (Japanese)
          > pangoterm: https://launchpad.net/pangoterm/
          >

          Very nice, thanks!

          regards,
          Christian
          --
          Wie man sein Kind nicht nennen sollte:
          Rod Ation

          --
          --
          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

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        Your message has been successfully submitted and would be delivered to recipients shortly.