~ubuntu-branches/ubuntu/natty/monodevelop/natty

« back to all changes in this revision

Viewing changes to src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Statuses.cs

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Ebner
  • Date: 2008-03-29 23:36:33 UTC
  • mto: (1.5.1 sid)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: james.westby@ubuntu.com-20080329233633-l550uuwvfh1e68at
Tags: upstream-1.0+dfsg
ImportĀ upstreamĀ versionĀ 1.0+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
720
720
                        if (difs != null) {
721
721
                                foreach (DiffInfo di in difs) {
722
722
                                        if (di.FileName == file) {
723
 
                                                filestore.SetValue (iter, ColPath, Colorize (di.Content));
 
723
                                                filestore.SetValue (iter, ColPath, di.Content);
724
724
                                                return;
725
725
                                        }
726
726
                                }
728
728
                        filestore.SetValue (iter, ColPath, GLib.Markup.EscapeText (GettextCatalog.GetString ("No differences found")));
729
729
                }
730
730
                
731
 
                string Colorize (string txt)
732
 
                {
733
 
                        txt = GLib.Markup.EscapeText (txt);
734
 
                        StringReader sr = new StringReader (txt);
735
 
                        StringBuilder sb = new StringBuilder ();
736
 
                        string line;
737
 
                        while ((line = sr.ReadLine ()) != null) {
738
 
                                if (line.Length > 0) {
739
 
                                        char c = line [0];
740
 
                                        if (c == '-') {
741
 
                                                line = "<span foreground='red'>" + line + "</span>";
742
 
                                        } else if (c == '+')
743
 
                                                line = "<span foreground='blue'>" + line + "</span>";
744
 
                                }
745
 
                                sb.Append (line).Append ('\n');
746
 
                        }
747
 
                        return sb.ToString ();
748
 
                }
749
 
                
750
731
                void OnFillDifs (object s, EventArgs a)
751
732
                {
752
733
                        diffRenderer.Reset ();