diff options
author | Jeffrey Stedfast <fejj@gnome.org> | 2011-03-04 01:14:21 +0300 |
---|---|---|
committer | Jeffrey Stedfast <fejj@gnome.org> | 2011-03-04 01:14:21 +0300 |
commit | ff390417632043b9df7aed8be7dc6b27da30c4af (patch) | |
tree | abb214f927c17a799e742c06d2e24f7820bce3cf /main/src/addins/CBinding | |
parent | 102f31bb7f107436066b4290fab9bcd53f94ae45 (diff) |
Drop region/endregion support in CBinding
Diffstat (limited to 'main/src/addins/CBinding')
-rw-r--r-- | main/src/addins/CBinding/Formatting/CIndentEngine.cs | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/main/src/addins/CBinding/Formatting/CIndentEngine.cs b/main/src/addins/CBinding/Formatting/CIndentEngine.cs index 8cf9d96031..0e13ecb968 100644 --- a/main/src/addins/CBinding/Formatting/CIndentEngine.cs +++ b/main/src/addins/CBinding/Formatting/CIndentEngine.cs @@ -308,30 +308,6 @@ namespace CBinding.Formatting return str == "default"; } - // directive keywords that we care about - static string[] directiveKeywords = new string [] { "region", "endregion" }; - - string GetDirectiveKeyword (char currentChar) - { - if (currentChar != ' ' && currentChar != '\t' && currentChar != '\n') - return null; - string str = linebuf.ToString ().TrimStart ().Substring (1); - - if (str.Length == 0) - return null; - - for (int i = 0; i < directiveKeywords.Length; i++) { - if (directiveKeywords[i].StartsWith (str)) { - if (str == directiveKeywords[i]) - return directiveKeywords[i]; - else - return null; - } - } - - return string.Empty; - } - bool Folded2LevelsNonSpecial () { return stack.PeekInside (0) == Inside.FoldedStatement && @@ -343,7 +319,7 @@ namespace CBinding.Formatting bool FoldedClassDeclaration () { return stack.PeekInside (0) == Inside.FoldedStatement && - (keyword == "base" || keyword == "class" || keyword == "interface"); + (keyword == "base" || keyword == "class"); } void PushFoldedStatement () @@ -870,18 +846,6 @@ namespace CBinding.Formatting } else if (c == ':' && WordIsDefault ()) { keyword = "default"; } - } else if ((inside & (Inside.PreProcessor)) != 0 && stack.PeekKeyword (0) == null) { - // replace the stack item with a keyworded one - string preProcessorKeyword = GetDirectiveKeyword (c); - int peekLine = stack.PeekLineNr (0); - stack.Pop (); - stack.Push (Inside.PreProcessor, preProcessorKeyword, peekLine, 0); - // regions need to pop back out - if (preProcessorKeyword == "region" || preProcessorKeyword == "endregion") { - curIndent = stack.PeekIndent (0); - needsReindent = true; - - } } //Console.WriteLine ("Pushing '{0}'/#{3}; wordStart = {1}; keyword = {2}", c, wordStart, keyword, (int)c); |