Weird indentation bug

I have a weird bug with eclipses indenting. Some reason the shifted right at the start is causing this because as soon as I removed it and did Crtl + A then Ctrl + I it moved the second line in line with first one but not the third because of the shifted right in the second line. Sorry if this is the wrong topic. Anyone has any fix, I would like it :slight_smile:

public void render(int xOffset, int yOffset, Screen screen)
	{
		int x1 = xOffset >> 4;
				int x2 = (screen.width + 16) >> 4;
				int y1 = yOffset >> 4;
				int y2 = (screen.height + 16) >> 4;
				screen.setOffset(xOffset, yOffset);
				for(int y = y1; y < y2 + y1 ; y++)
				{
					for(int x = x1; x < x2 + x1; x++)
					{
						getTile(x, y).render(x, y, screen);
					}
				}
				screen.setOffset(xOffset, yOffset);
	}

Looks to me that all the lines, except for [icode]int x1 = xOffset >> 4;[/icode] is indenting wrong in the block. ^^

EDIT: But then, I have no idea what you think is the wrong indentation, couldn’t decipher your second sentence. :s

Yeah I had to write that long sentence. Sorry but here is a better example and I have not edited any indentation. This is just Eclipse’s way of doing it.

CODE WITH SHIFTED RIGHT and CTRL +I

public void render(int xOffset, int yOffset, Screen screen)
	{
		screen.setOffset(xOffset, yOffset);
		int x1 = xOffset >> 4;
				int x2 = (xOffset + screen.width) >> 4;
				int y1 = yOffset >> 4;
				int y2 = (yOffset + screen.height) >> 4;

				for(int y = y1; y < y2; y++)
				{
					for(int x = x1; x < x2; x++)
					{
						getTile(x, y).render(x, y, screen);
					}
				}
	}

CODE WITHOUT SHIFTED RIGHT and CTRL +I

public void render(int xOffset, int yOffset, Screen screen)
	{
		screen.setOffset(xOffset, yOffset);
		int x1 = xOffset;
		int x2 = (xOffset + screen.width);
		int y1 = yOffset;
		int y2 = (yOffset + screen.height);

		for(int y = y1; y < y2; y++)
		{
			for(int x = x1; x < x2; x++)
			{
				getTile(x, y).render(x, y, screen);
			}
		}
	}

If you reformat the code with shift-ctrl-f does it stay formatted that way? If so, you clearly have something amiss in your formatting settings, otherwise your quirky brace style is likely confusing things.

When I do that it goes back to the formatted way and looks correct but CTRL + It still doesn’t work properly.