JEditTextArea textArea = view.getTextArea(); int caretPosition = textArea.getCaretPosition(); Member member = members.getNextMember(caretPosition); if (member != null) { textArea.setCaretPosition(member.getStartOffset(), true); } else { textArea.setCaretPosition(textArea.getBufferLength() - 1, true);
if(!members.containsErrors()) { JEditTextArea textArea = view.getTextArea(); int caretPosition = textArea.getCaretPosition(); Member member = members.getNextMember(caretPosition);  if (member != null) { textArea.setCaretPosition(member.getStartOffset(), true); } else { textArea.setCaretPosition(textArea.getBufferLength() - 1, true); }
    public static void nextMethod(View view) {        RubyMembers members = RubyParser.getMembers(view);        JEditTextArea textArea = view.getTextArea();        int caretPosition = textArea.getCaretPosition();        Member member = members.getNextMember(caretPosition);        if (member != null) {            textArea.setCaretPosition(member.getStartOffset(), true);        } else {            textArea.setCaretPosition(textArea.getBufferLength() - 1, true);        }    }