int magic = getMagicCaretPosition(); if(magic == -1) { magic = offsetToX(line,caret - getLineStartOffset(line)); }
int magic = magicCaret;
	public void goToPrevLine(boolean select)	{		int caret = getCaretPosition();		int line = getCaretLine();		int magic = getMagicCaretPosition();		if(magic == -1)		{			magic = offsetToX(line,caret - getLineStartOffset(line));		}		int prevLine = buffer.getPrevVisibleLine(line);		if(prevLine == -1)		{			getToolkit().beep();			return;		}		caret = getLineStartOffset(prevLine) + xToOffset(prevLine,magic + 1);		if(select)			select(getMarkPosition(),caret);		else			setCaretPosition(caret);		setMagicCaretPosition(magic);	}