Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Krüger <mkrueger@novell.com>2009-09-18 20:09:48 +0400
committerMike Krüger <mkrueger@novell.com>2009-09-18 20:09:48 +0400
commit108f8b531cc75a84d1e758fa677cb7f5c88f7407 (patch)
treea8e4fd183447c3b335f2fab864d549d50f745aec /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates
parent67c3049eb0e5f542d00149195519d156857d7992 (diff)
Code template fixes.
svn path=/trunk/monodevelop/; revision=142198
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates')
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs17
1 files changed, 12 insertions, 5 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs
index 846579285b..799fd2c672 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs
@@ -246,18 +246,25 @@ namespace MonoDevelop.Ide.CodeTemplates
}
sb.Append (s);
} else {
- link.AddLink (new Segment (sb.Length, variableDecarations[name].Default.Length));
- sb.Append (variableDecarations[name].Default);
+ AddDefaultValue (sb, link, name);
}
- } else {
- link.AddLink (new Segment (sb.Length, variableDecarations[name].Default.Length));
- sb.Append (variableDecarations[name].Default);
+ } else {
+ AddDefaultValue (sb, link, name);
}
}
sb.Append (code.Substring (lastOffset, code.Length - lastOffset));
result.Code = sb.ToString ();
return result;
}
+
+ void AddDefaultValue (StringBuilder sb, TextLink link, string name)
+ {
+ if (string.IsNullOrEmpty (variableDecarations[name].Default))
+ return;
+ link.AddLink (new Segment (sb.Length, variableDecarations[name].Default.Length));
+ sb.Append (variableDecarations[name].Default);
+ }
+
public string IndentCode (string code, string indent)
{