int lastIndent = textArea.getLineEndOffset(line) - MiscUtilities.getTrailingWhiteSpace(textArea .getLineText(line)) - 1;
int lastIndent = MiscUtilities.getTrailingWhiteSpace(textArea .getLineText(line));
	public void actionPerformed(ActionEvent evt)	{		View view = getView(evt);		JEditTextArea textArea = view.getTextArea();		InputHandler inputHandler = view.getInputHandler();		int caret = textArea.getCaretPosition();		int line = textArea.getCaretLine();		int lastIndent = textArea.getLineEndOffset(line)			- MiscUtilities.getTrailingWhiteSpace(textArea			.getLineText(line)) - 1;		int lastOfLine = textArea.getLineEndOffset(			textArea.getCaretLine()) - 1;		int lastVisibleLine = textArea.getFirstLine()			+ textArea.getVisibleLines();		if(lastVisibleLine >= textArea.getLineCount())			lastVisibleLine = textArea.getLineCount() - 1;		else if(lastVisibleLine <= textArea.getElectricScroll())			lastVisibleLine = 0;		else			lastVisibleLine -= (textArea.getElectricScroll() + 1);		int lastVisible = textArea.getLineEndOffset(lastVisibleLine) - 1;		int[] positions = { lastIndent, lastOfLine, lastVisible };		int count;		if(!jEdit.getBooleanProperty("view.homeEnd"))			count = 1;		else if(inputHandler.getLastAction() == this)		{			count = Math.min(positions.length,inputHandler				.getLastActionCount()) - 1;		}		else			count = 0;		caret = positions[count];		if(select)			textArea.select(textArea.getMarkPosition(),caret);		else			textArea.setCaretPosition(caret);	}