return scrollTo(line,offset);
if(visibleLines == 0) { setFirstLine(Math.max(0,caretLine - electricScroll)); return; }  boolean changed = false;  int _firstLine = firstLine + electricScroll; int _lastLine = firstLine + visibleLines - electricScroll; if(caretLine > _firstLine && caretLine < _lastLine) {  } else if(_firstLine - caretLine > 5 || caretLine - _lastLine > 5) { int markLine = getMarkLine();   firstLine = markLine - (visibleLines - caretLine + markLine) / 2; firstLine = Math.max(caretLine - visibleLines + electricScroll,firstLine); firstLine = Math.min(caretLine  - electricScroll,firstLine);  changed = true; } else if(caretLine < _firstLine) { firstLine = Math.max(0,caretLine - electricScroll);  changed = true; } else if(caretLine >= _lastLine) { firstLine = (caretLine - visibleLines) + electricScroll + 1; if(_firstLine >= getLineCount()) firstLine = getLineCount() - visibleLines; if(firstLine < 0) firstLine = 0;  changed = true; }  int x = offsetToX(caretLine,offset); int width = painter.getFontMetrics().charWidth('w');  if(x < 0) { horizontalOffset = Math.min(0,horizontalOffset - x + width + 5); changed = true; } else if(x + width >= painter.getWidth()) { horizontalOffset = horizontalOffset + (painter.getWidth() - x) - width - 5; changed = true; }  if(changed) { updateScrollBars(); painter.repaint();  if(!gutter.isCollapsed()) gutter.repaint(); }
	public boolean scrollToCaret()	{		int line = getCaretLine();		int lineStart = getLineStartOffset(line);		int offset = Math.max(0,Math.min(getLineLength(line) - 1,			getCaretPosition() - lineStart));		return scrollTo(line,offset);	}