Backward search in the internal viewer

Andrew V. Samoilov kai at cmail.ru
Fri Nov 1 12:55:03 UTC 2002


Pavel Roskin wrote:

> I have finally found time to test your patch, but it didn't apply cleanly.  
> I could apply it by hand, but I'm not sure if I did it right.

I found and fixed bug in the original normal_search() (it was not 
reported yet) when reviwed this patch.

> 
> I don't like introducing another preprocessor symbol NO_BK_SEARCH,
> especially because symbols with the negative meaning (NO_something,
> DISABLE_this) force the developers to apply an additional logical
> operation in their heads.

;-)

> 
> I decided to "prepare ground" to make the final patch easier to read.  I
> reformatted view.c 

Such huge reformatting make me nervious little.  It does not make 
writting (and supporting of unofficial) patches easier.  Also it makes 
harder to apply patches from places like RedHat Bugzilla and so on.

> and changed charset.h so that it now provides dummy
> macros to be used when the charset support is disabled.

> 
> I'm attaching your patch against the new view.c, without and single
> preprocessor directive.  Please check that convert_from_input() is called
> right, it could have been duplicated when I was applying your patch.
> 
> I still don't feel I can apply this patch without having more time to
> review the patch and running it through gdb.  But I'll do it after you
> check the simplified version.

I fixed segmentation violation in new view.c, so it does not aplly 
cleanly again, but it was OK. I am attaching new incarnation against new 
view.c.  I don't like current situation around mess with 
view->direction.  It should be changed in some places, but it is not done.

BTW, I fill needs to rewrite _icase_search() from util.c and to move it 
to view.c.  It handles backspaces and this part is direction-sensitive. 
  Also it will be possible to use get_byte() there, so get_one_at() will 
be usefull for regexp_search().  This will make searches faster and will 
consume less memory.  But I am not sure it will be done in the nearest 
weeks.

-- 
Regards,
Andrew V. Samoilov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: view-back-search.diff.bz2
Type: application/x-bzip2
Size: 1907 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20021101/dfd6375e/attachment.bz2>


More information about the mc-devel mailing list