[prev in list] [next in list] [prev in thread] [next in thread]
List: jedit-users
Subject: Re: Re: [ jEdit-users ] SearchAndReplace problem in macros
From: Slava Pestov <slava () jedit ! org>
Date: 2002-12-28 5:16:45
[Download RAW message or body]
This e-mail is from April 2002 and I'm not sure if the original poster
is still on the list, but the bug described should be fixed in 4.1pre7.
On Wed, 2002-04-24 at 02:12, HaJo.Wuellner@arxes.de wrote:
> Hello,
>
> I know, but the last search isn't a regexp search
> (after ---> This searches always forward).
> Buut I tested some more and thereason is, that the last
> search wraps around. It does not find the pattern from
> the actual position to the start and then searches from
> the end. But you can see I set AutoWrapAround to false.
> Does this not work for bachward search ?
>
> begin Slava Pestov <slava@jedit.org> quotation
> > Hi,
> >
> > Backwards regexp search is not supported.
> >
> > On Wed, 2002-04-24 at 00:45, HaJo.Wuellner@arxes.de wrote:
>
> > > Hi,
> > >
> > > I have problems using SearchAndReplace in macros.
> > > When I want to search backward for string and did a
> > > forward/regexp search before the search is always
> > > done in forward mode.
> > > I have played a lot with the order of setting the SearchAndReplace
> > > options, but I cannot get it working.
> > >
> > > Here the code snippet:
> > >
> > > // Search for LOCAL Definition
> > > hitline = 0;
> > > SearchAndReplace.setSearchString("LOCAL\\s+" + searchString
> + "
> > > \\s*$");
> > > SearchAndReplace.setReverseSearch(false);
> > > SearchAndReplace.setRegexp(true);
> > > SearchAndReplace.setAutoWrapAround(false);
> > > SearchAndReplace.setIgnoreCase(false);
> > > SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
> > > if (SearchAndReplace.find(view)) {
> > > // Check boundary
> > > hitline=textArea.getCaretPosition();
> > > if (hitline > endline) { hitline = 0; }
> > > }
> > >
> > > // LOCAL not found
> > > if (hitline == 0) {
> > > lastLocalLine = 0;
> > > // Go to end of macro and search last LOCAL-row
> > > textArea.setCaretPosition(endline);
> > >
> > > ---> This searches always forward
> > > SearchAndReplace.setSearchString("LOCAL ");
> > > SearchAndReplace.setRegexp(false);
> > > SearchAndReplace.setReverseSearch(true);
> > > SearchAndReplace.setAutoWrapAround(false);
> > > SearchAndReplace.setIgnoreCase(false);
> > > SearchAndReplace.setSearchFileSet(new CurrentBufferSet
> ());
> > > if (SearchAndReplace.find(view)) {
> > > // Check boundary
> > > lastLocalLine=textArea.getCaretPosition();
> > > if (lastLocalLine < startline) { lastLocalLine = 0;
> }
> > > }
> > >
> > > Any ideas ?--
> > >
> > > tia
> > > --
> > > Hajo
> > >
> > >
> > > --
> > > -----------------------------------------------
> > > jEdit Users' List
> > > jEdit-users@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/jedit-users
> > --
> > Slava Pestov
> --
> Hajo
--
Slava Pestov <slava@jedit.org>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
--
-----------------------------------------------
jEdit Users' List
jEdit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic