keyboardMacros.rc
changeset 1068 fd1c4a3e86fc
parent 936 f0563e73619a
child 1070 d3525fab5c67
--- a/keyboardMacros.rc	Fri Sep 25 15:39:50 2009 +0200
+++ b/keyboardMacros.rc	Tue Sep 29 18:01:18 2009 +0200
@@ -402,29 +402,34 @@
 			col2 := (self listAt:lineNr) size.
 		    ].
 		    isAllLower := isAllUpper := isUpperFirst := true.
-		    col1 to:col2 do:[:col |
-			|ch|
+		    col1 = col2 ifTrue:[
+			isAllLower := (line at:col1) isLowercase.
+			isAllUpper := isUpperFirst := isAllLower not.
+		    ] ifFalse:[
+			col1 to:col2 do:[:col |
+			    |ch|
 
-			ch := line at:col.
-			ch isUppercase ifTrue:[
-			    isAllLower := false.
-			    col ~~ col1 ifTrue:[
-				isUpperFirst := false.
-			    ].
-			] ifFalse:[
-			    ch isLowercase ifTrue:[
-				isAllUpper := false.
-				col == col1 ifTrue:[
+			    ch := line at:col.
+			    ch isUppercase ifTrue:[
+				isAllLower := false.
+				col ~~ col1 ifTrue:[
 				    isUpperFirst := false.
 				].
-			    ]
+			    ] ifFalse:[
+				ch isLowercase ifTrue:[
+				    isAllUpper := false.
+				    col == col1 ifTrue:[
+					isUpperFirst := false.
+				    ].
+				]
+			    ].
 			].
 		    ].
 		    makeLowercase := makeUppercase := makeUppercaseFirst := false.
 		    isAllLower ifTrue:[
 			makeUppercase := true.
 		    ] ifFalse:[
-			isAllUpper ifTrue:[
+			(isAllUpper and:[col1 ~= col2]) ifTrue:[
 			    makeUppercaseFirst := true.
 			] ifFalse:[
 			    makeLowercase := true.