Bug 46875 [typing] Tabs are messed up
When I type code that has string literals in it, and press enter to move the string literal to the next line, the tab logic seems strange. e.g. String twoLines = "System Contains Many Defects,Systemet innehaller manga fel\n"+"Stories Are Too Complicated,Stories ar for komplicerade"; Move the cursor after + and press enter. It somehow moves the new line to column 0, while I'd expect it to align with the first line. If you try this with a single string, the bug will still be seen. Interestingly, when I am within a method's parantheses, the behavior is different. e.g. assertEquals( "converted data", "Systemet+innehaller+manga+fel|Stories+ar+for+komplicerade",convertedData .toString() ); Note, the two lines within have a single tab each. Now position the cursor on convertedData and press enter - while I'd expect it to line up with the previous line (two tabs), the IDE adds three tabs. Now here's the one which really annoys me: assertEquals( There is one tab before assertEquals. Press enter after the paranthesis. Three tabs are inexplicably put in. I would expect only two. I am assuming these are bugs as previous releases had the right behavior. Regards, Somik
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaStringAutoIndentStrategy.java
StringBuffer tokenBuffer = new StringBuffer();
			for (int i = 0; i < token.length(); i++){ 
				char c = token.charAt(i);
				switch (c) {
					case '\r' :
						tokenBuffer.append("\\r"); 
						break;
					case '\n' :
						tokenBuffer.append("\\n"); 
						break;
					case '\b' :
						tokenBuffer.append("\\b"); 
						break;
					case '\t' :
						
						tokenBuffer.append("\t"); 
						break;
					case '\f' :
						tokenBuffer.append("\\f"); 
						break;
					case '\"' :
						tokenBuffer.append("\\\""); 
						break;
					case '\'' :
						tokenBuffer.append("\\'"); 
						break;
					case '\\' :
						tokenBuffer.append("\\\\"); 
						break;