Syntax Highlighting for Diff View

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Syntax Highlighting for Diff View

SmartGit mailing list
It would be really great to have the option to enable syntax highlighting for side-by-side diff views.  I searched around and could not find an option for it.  Please let me know if I'm mistaken.
 

 chad.
 

Reply | Threaded
Open this post in threaded view
|

Re: Syntax Highlighting for Diff View

SmartGit mailing list
> It would be really great to have the option to enable syntax highlighting for
> side-by-side diff views.  I searched around and could not find an option for it.
> Please let me know if I'm mistaken.

All diff views should have syntax highlighting enabled always. What kind of file are you comparing (extension)? Would you like to switch it off? In this case, why?

--
Best regards,
Marc Strapetz
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com



08/31/2014 18:30 - [hidden email] [smartgit] wrote:

> It would be really great to have the option to enable syntax highlighting for
> side-by-side diff views.  I searched around and could not find an option for it.
> Please let me know if I'm mistaken.
>  
>
>  chad.
>  
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Syntax Highlighting for Diff View

SmartGit mailing list
I did some investigation.  It seems that the syntax highlighter has issues with long strings (at least for python files):  if the file has a string that is too many characters then the syntax highlighting is disabled.  In practice, strings that break the highlighting are multi-line strings but in my testing they do not need to be.  Since it is standard practice to use multi-line strings for documentation in python, smartgit fails to do synatx highlighting for most of the python files in my repositories.

 Below is an example. If you delete the last line of the doc string the syntax highlighting will start working again.
 

 

 '''
 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla orci ipsum,
 fermentum et enim eu, sodales laoreet libero. Nullam vulputate, magna sit amet
 tempor suscipit, elit metus vestibulum arcu, a bibendum orci erat sit amet
 risus. Suspendisse eu malesuada mauris. Aenean euismod molestie urna, id tempus
 ante cursus id. Fusce commodo eros ac turpis tincidunt tempor. Sed rutrum est
 velit, et consequat dui placerat in. Cum sociis natoque penatibus et magnis dis
 parturient montes, nascetur ridiculus mus. Cras nec malesuada purus. Maecenas
 in purus eu ante commodo gravida.
 

 Morbi condimentum mi vel ex molestie, at aliquam erat fringilla. Maecenas
 posuere libero sit amet lectus ultricies, iaculis consequat magna rhoncus.
 Nunc iaculis vel neque ac dignissim. Nullam pharetra ipsum sed orci aliquam
 euismod. Duis interdum urna et purus ornare rhoncus. Donec bibendum odio
 lectus, ut ultrices purus rhoncus sit amet. Cras ac dui odio. Etiam a
 pellentesque augue. Donec sagittis, urna eu vulputate consectetur, ante dui
 rhoncus nisi, sed consequat dolor tortor id eros. Pellentesque sed pretium
 nisi. In nec arcu ipsum. Cras sem tortor, vulputate eu nibh ut, rutrum vehicula
 lectus. Morbi luctus auctor gravida. Curabitur luctus enim eget est feugiat
 placerat.
 

 Proin fringilla quis ex vel suscipit. Donec vel mollis libero, id tristique
 ante. Maecenas consequat vehicula nisl id laoreet. Fusce id nisl vitae nisl
 sagittis tincidunt. Cras cursus accumsan massa, sollicitudin accumsan lectus
 varius nec. Aliquam erat volutpat.
 '''
 

 from collections import defaultdict
 import functools
 import traceback
 import re
 import os
 import math
 


 

Reply | Threaded
Open this post in threaded view
|

Re: Syntax Highlighting for Diff View

SmartGit mailing list
> I did some investigation.  It seems that the syntax highlighter has issues with
> long strings (at least for python files):  if the file has a string that is too
> many characters then the syntax highlighting is disabled.

I've tried with your test file, but highlighting was fine. Can you please trigger the problem again, then send log.txt.* files (from the Settings directory, see About dialog) and the zipped file for which highlighting fails to [hidden email]?

--
Best regards,
Marc Strapetz
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com


09/01/2014 19:20 - [hidden email] [smartgit] wrote:

> I did some investigation.  It seems that the syntax highlighter has issues with
> long strings (at least for python files):  if the file has a string that is too
> many characters then the syntax highlighting is disabled.  In practice, strings
> that break the highlighting are multi-line strings but in my testing they do not
> need to be.  Since it is standard practice to use multi-line strings for
> documentation in python, smartgit fails to do synatx highlighting for most of the
> python files in my repositories.
>
>  Below is an example. If you delete the last line of the doc string the syntax
> highlighting will start working again.
>  
>
>  
>
>  '''
>  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla orci ipsum,
>  fermentum et enim eu, sodales laoreet libero. Nullam vulputate, magna sit amet
>  tempor suscipit, elit metus vestibulum arcu, a bibendum orci erat sit amet
>  risus. Suspendisse eu malesuada mauris. Aenean euismod molestie urna, id tempus
>  ante cursus id. Fusce commodo eros ac turpis tincidunt tempor. Sed rutrum est
>  velit, et consequat dui placerat in. Cum sociis natoque penatibus et magnis dis
>  parturient montes, nascetur ridiculus mus. Cras nec malesuada purus. Maecenas
>  in purus eu ante commodo gravida.
>  
>
>  Morbi condimentum mi vel ex molestie, at aliquam erat fringilla. Maecenas
>  posuere libero sit amet lectus ultricies, iaculis consequat magna rhoncus.
>  Nunc iaculis vel neque ac dignissim. Nullam pharetra ipsum sed orci aliquam
>  euismod. Duis interdum urna et purus ornare rhoncus. Donec bibendum odio
>  lectus, ut ultrices purus rhoncus sit amet. Cras ac dui odio. Etiam a
>  pellentesque augue. Donec sagittis, urna eu vulputate consectetur, ante dui
>  rhoncus nisi, sed consequat dolor tortor id eros. Pellentesque sed pretium
>  nisi. In nec arcu ipsum. Cras sem tortor, vulputate eu nibh ut, rutrum vehicula
>  lectus. Morbi luctus auctor gravida. Curabitur luctus enim eget est feugiat
>  placerat.
>  
>
>  Proin fringilla quis ex vel suscipit. Donec vel mollis libero, id tristique
>  ante. Maecenas consequat vehicula nisl id laoreet. Fusce id nisl vitae nisl
>  sagittis tincidunt. Cras cursus accumsan massa, sollicitudin accumsan lectus
>  varius nec. Aliquam erat volutpat.
>  '''
>  
>
>  from collections import defaultdict
>  import functools
>  import traceback
>  import re
>  import os
>  import math
>  
>
>
>  
>
>