try { RE regexp = jEdit.getRE(); if(regexp == null) { view.getToolkit().beep(); return false; } int caret = view.getTextArea().getCaretPosition(); String text = getText(caret,getLength() - caret); REMatch match = regexp.getMatch(text); if(match != null) { view.getTextArea().select(caret + match .getStartIndex(), caret + match.getEndIndex()); return true; } if(done) { view.getToolkit().beep(); return false; } int result = JOptionPane.showConfirmDialog(view, jEdit.getProperty("keepsearching.message"), jEdit.getProperty("keepsearching.title"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if(result == JOptionPane.YES_OPTION) { view.getTextArea().setCaretPosition(0); return find(view,true); } } catch(REException re) { Object[] args = { re.getMessage() }; jEdit.error(view,"reerror",args); } catch(BadLocationException bl) { } return false;
return find(view,view.getTextArea().getCaretPosition(),done);
	public boolean find(View view, boolean done)	{		try		{			RE regexp = jEdit.getRE();			if(regexp == null)			{				view.getToolkit().beep();				return false;			}			int caret = view.getTextArea().getCaretPosition();			String text = getText(caret,getLength() - caret);			REMatch match = regexp.getMatch(text);			if(match != null)			{				view.getTextArea().select(caret + match					.getStartIndex(),					caret + match.getEndIndex());				return true;			}			if(done)			{				view.getToolkit().beep();				return false;			}			int result = JOptionPane.showConfirmDialog(view,				jEdit.getProperty("keepsearching.message"),				jEdit.getProperty("keepsearching.title"),				JOptionPane.YES_NO_OPTION,				JOptionPane.QUESTION_MESSAGE);			if(result == JOptionPane.YES_OPTION)			{				view.getTextArea().setCaretPosition(0);				return find(view,true);			}		}		catch(REException re)		{			Object[] args = { re.getMessage() };			jEdit.error(view,"reerror",args);		}		catch(BadLocationException bl)		{		}		return false;	}