Menu

#9 Suggestion/question: option to export to HTML the style resulting from calling matchadd()

open
nobody
2023-09-05
2017-04-19
Anonymous
No

Originally created by: fritzophrenic

Original report by Anonymous.


I color text using matchadd() function, text that is already syntax highlighted (just in case that makes any difference).

Not sure if it is intended or not, but when I call :TOhtml on that text the syntax is kept but the matches are gone (I tried out with :match as well and it is gone too).

is this intended behavior? In case it is, is there any way to go around this so I can export the matchadd() highlight?

Thanks a lot for the plugin, I use it quite a bit. Sorry for contacting you using an issue, I couldn't find any contact info.

Discussion

  • Anonymous

    Anonymous - 2017-04-27

    Originally posted by: fritzophrenic

    Original comment by Ben Fritz (Bitbucket: fritzophrenic NA, ).


    I thought I remembered a patch at some point adding a function to get highlight information about matches like is available for syntax. I can't seem to find that now, am I making that up?

     
  • Anonymous

    Anonymous - 2017-04-28

    Originally posted by: fritzophrenic

    Original comment by mikel (Bitbucket: mikelgarai, GitHub: mikelgarai).


    Hi there! thanks for the plugin.

    to be honest I'm not even sure how to find the code of your plugin in my repo (debian testing) so no idea even which version I have or which is the source code to look at it.

    regarding the match list I search it and there is this function called getmatches() that seems to return a list with the matches, maybe you can grep it in the code.

    please let me know if there is something I can do to help, I have very little knowledge about vimscript but I think I can manage to debug a little if it helps.

    thanks!

     
  • Anonymous

    Anonymous - 2017-04-28

    Originally posted by: fritzophrenic

    Original comment by mikel (Bitbucket: mikelgarai, GitHub: mikelgarai).


    by the way I'm the original reporter, I just didn't have an account when I created the ticket.

     
  • Anonymous

    Anonymous - 2017-04-28

    Originally posted by: fritzophrenic

    Original comment by mikel (Bitbucket: mikelgarai, GitHub: mikelgarai).


    Ok, so I checked the source code of the plugin and seems like debian testing has the last version

    I think I found out how 2html gets the syntax, using synID() function, that unfortunately does not work with match/2match/matchadd()... and I couldn't :help or google any alternative for it T_T

    I hope I'm missing something..

     
  • Anonymous

    Anonymous - 2017-05-31

    Originally posted by: fritzophrenic

    Original comment by Ben Fritz (Bitbucket: fritzophrenic NA, ).


    Related: https://groups.google.com/d/msg/vim_dev/tu3rR0Mx-9s/57g5gjtWAAAJ

    TODO: See if the attached zip file contains an implementation I can use, if not then at least verify that the final solution works for diffchar.vim plugin as noted in the thread.

     
  • Anonymous

    Anonymous - 2017-06-22

    Originally posted by: fritzophrenic

    Original comment by mikel (Bitbucket: mikelgarai, GitHub: mikelgarai).


    Thanks Fritzophrenic, I will try it out and report you back with the result.

    Best Regards!

    mIKEL

     
  • fritzophrenic

    fritzophrenic - 2023-09-05

    https://github.com/vim/vim/issues/1725 Github issue to go along with the vim_dev thread above.

     

Log in to post a comment.