is there any way to diff code in different tabs in Frescobaldi?
You want to compare two files opened in different tabs, right? Can you add a feature request on GitHub? Frescobaldi can show a diff when running convert-ly: https://github.com/frescobaldi/frescobaldi/blob/master/frescobaldi/convert_ly.py#L182 Something similar may be used for two opened files.
