joxeankoret / diaphora

Diaphora, the most advanced Free and Open Source program diffing tool.
http://diaphora.re
GNU Affero General Public License v3.0
3.64k stars 372 forks source link

How can I change the pygments 'style' in decompilation/diff view? #312

Open agnosticlines opened 2 months ago

agnosticlines commented 2 months ago

Hi Joxean, I've written a pygments style file for my theme of choice and I'd like to hook it up to diaphora, how can I go about doing this? There doesn't seem to be a way to modify it for example in the cfg file, diaphora is a fantastic tool but I always have to change my IDA theme back to the default one to get the diff/patch view working properly :-(

Been grepping around trying to find it, seems to be used in CHtmlViewer and HtmlViewer, would be really nice if there was a centralised place to swap the theme

joxeankoret commented 2 months ago

I don't really know, to be honest. Let me take a look to it tonight...

agnosticlines commented 2 months ago

Fair enough! I think I've offered to sponsor full theme support for diaphora before, it's the one obstacle I have to using it, I really really love my custom theme, I'd love it if it just took IDA theme support, but not sure if there's a 1->1 mapping for those and diaphora's UI elements, like the diff colours etc

joxeankoret commented 2 months ago

Uhm... are you using the official IDA themes support or a plugin? If it's the official method, I believe I could somehow easily support it.

agnosticlines commented 2 months ago

Yeah official ida themes with CSS https://github.com/catppuccin/ida-debugger etc

joxeankoret commented 2 months ago

Note to myself: it can be implemented following the recommendation of Igor to read from the registry the current theme, and then parsing the CSS of the theme to get the colours. Not terribly trivial, but can be implemented.

agnosticlines commented 2 months ago

Note to myself: it can be implemented following the recommendation of Igor to read from the registry the current theme, and then parsing the CSS of the theme to get the colours. Not terribly trivial, but can be implemented.

Happy to donate to some goal of getting it landed if that'd help