[mapguide-commits] r7699 - trunk/Tools/Maestro/Thirdparty/SharpDevelop/ICSharpCode.TextEditor/Src/Gui

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Jul 25 23:43:31 PDT 2013


Author: jng
Date: 2013-07-25 23:43:31 -0700 (Thu, 25 Jul 2013)
New Revision: 7699

Modified:
   trunk/Tools/Maestro/Thirdparty/SharpDevelop/ICSharpCode.TextEditor/Src/Gui/TextView.cs
Log:
#2311: r7680 was too aggressive, causing some undesired cursor behaviour. This submission moves the "bail if divisor is 0" check to right before the actual line where the division is made. The undesired cursor behaviour is no longer present.

Modified: trunk/Tools/Maestro/Thirdparty/SharpDevelop/ICSharpCode.TextEditor/Src/Gui/TextView.cs
===================================================================
--- trunk/Tools/Maestro/Thirdparty/SharpDevelop/ICSharpCode.TextEditor/Src/Gui/TextView.cs	2013-07-21 15:51:59 UTC (rev 7698)
+++ trunk/Tools/Maestro/Thirdparty/SharpDevelop/ICSharpCode.TextEditor/Src/Gui/TextView.cs	2013-07-26 06:43:31 UTC (rev 7699)
@@ -700,8 +700,6 @@
 			int lineOffset = line.Offset;
 			int tabIndent = Document.TextEditorProperties.TabIndent;
 			int guessedColumn = 0;
-			if (tabIndent == 0)
-				return guessedColumn;
 			for (int i = 0; i < logicalColumn; ++i) {
 				char ch;
 				if (i >= line.Length) {
@@ -711,8 +709,11 @@
 				}
 				switch (ch) {
 					case '\t':
-						guessedColumn += tabIndent;
-						guessedColumn = (guessedColumn / tabIndent) * tabIndent;
+                        if (tabIndent != 0)
+                        {
+                            guessedColumn += tabIndent;
+                            guessedColumn = (guessedColumn / tabIndent) * tabIndent;
+                        }
 						break;
 					default:
 						++guessedColumn;
@@ -832,9 +833,7 @@
 			List<TextWord> words = line.Words;
 			if (words == null) return 0;
 			int wordOffset = 0;
-			if (tabIndent == 0 || WideSpaceWidth == 0)
-				return wordOffset;
-
+			
 			for (int i = 0; i < words.Count; i++) {
 				TextWord word = words[i];
 				if (wordOffset >= end) {
@@ -850,6 +849,8 @@
 							break;
 						case TextWordType.Tab:
 							// go to next tab position
+                            if (tabIndent == 0 || WideSpaceWidth == 0)
+                                return wordOffset;
 							drawingPos = (int)((drawingPos + MinTabWidth) / tabIndent / WideSpaceWidth) * tabIndent * WideSpaceWidth;
 							newDrawingPos = drawingPos + tabIndent * WideSpaceWidth;
 							if (newDrawingPos >= targetVisualPosX)



More information about the mapguide-commits mailing list