issue-#37 fixing traps with long search patterns in DevSearc

Post Reply
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

issue-#37 fixing traps with long search patterns in DevSearc

Post by Josef Templ »

Long search patterns lead to traps in DevSearch.
see http://redmine.blackboxframework.org/issues/37

A proposal for fixing this exists in CPC1.7 rc5, however it does not
solve the traps but only increases the pattern length from 64 to 128.
In addition CPC1.7 introduces a modification to DevSearch:
It writes the complete search pattern into the output window where the search result is listed.
I really don't like this very much because the search pattern is shown in the window title anyway.
It only makes a difference if the search pattern is a very long or multi-line text.
Technically, it is a trivial change but do we really need it?

In addition, the title creation needs to be refined anyway because it also leads to traps.
So, a simple approach would be to replace tabs and line feeds by spaces for the title
and to display as much of it as possible in the title.
This is the behavior of the current changes in the topic branch.
The current changes in the topic branch also extend the search pattern to 256
because this is what TextCmds.find.find supports anyway.

For the diffs please see: http://redmine.blackboxframework.org/pr ... 3797952210

- Josef
User avatar
DGDanforth
Posts: 1061
Joined: Tue Sep 17, 2013 1:16 am
Location: Palo Alto, California, USA
Contact:

Re: issue-#37 fixing traps with long search patterns in DevS

Post by DGDanforth »

Again, seems reasonable.

Just a note: With GftSearchFiles where one can search for multiple patterns simultaneously it is necessary to specify for each file the pattern(s) actually found and hence the title of the search output is in sufficient. Also, the input multiple search patterns are separated by new lines.
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#37 fixing traps with long search patterns in DevS

Post by Josef Templ »

Helmut, what is the reason for writing the search pattern to the output file?
Could you please comment on it.

- Josef
Zinn
Posts: 476
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main
Contact:

Re: issue-#37 fixing traps with long search patterns in DevS

Post by Zinn »

Josef Templ wrote:Helmut, what is the reason for writing the search pattern to the output file?
Could you please comment on it.
When I copy the search result to another odc document then I often forgot to type the search pattern into that document. So I add it into the search result and I can copy the result including the search pattern.

I changed your new version from
-- List(list, pat, source, caseSens);
-- v := TextViews.dir.New(log);
-- GetTitle(pat, title);
-- Views.OpenAux(v, title);
to
-- GetTitle(pat, title);
-- w.WriteString(title); w.WriteLn;
-- List(list, pat, source, caseSens);
-- v := TextViews.dir.New(log);
-- Views.OpenAux(v, title);
in my CPC edition
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#37 fixing traps with long search patterns in DevS

Post by Josef Templ »

I never copied the search result into another text and I never felt any need for it.
Seems to be a very special kind of usage pattern. Does it really justify a change?
Anyway, if it is only for maintaining the CPC changes, the need for it should go away over time:-)

Since issue-#37 is classified as a bug, my proposal would be to discuss this 'feature' separately.
Helmut, please remind us if we forget about it.

- Josef
Post Reply