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
issue-#37 fixing traps with long search patterns in DevSearc
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
- 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
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.
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.
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#37 fixing traps with long search patterns in DevS
Helmut, what is the reason for writing the search pattern to the output file?
Could you please comment on it.
- Josef
Could you please comment on it.
- Josef
Re: issue-#37 fixing traps with long search patterns in DevS
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.Josef Templ wrote:Helmut, what is the reason for writing the search pattern to the output file?
Could you please comment on it.
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
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#37 fixing traps with long search patterns in DevS
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
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