From b5fea4de7f2e20fbb768aef2ed72249c80b1bf9d Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 2 Aug 2010 04:37:32 +0000 Subject: ViewCSV search is now regex based :) --- src/tools/viewcsv.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/tools') diff --git a/src/tools/viewcsv.cpp b/src/tools/viewcsv.cpp index 176f25e..d81525e 100644 --- a/src/tools/viewcsv.cpp +++ b/src/tools/viewcsv.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include using namespace Bu; @@ -249,6 +250,8 @@ public: int maxx, maxy; Bu::FString sStr; + RegEx re( sPrompt ); + curs_set( 1 ); for(;;) { @@ -273,7 +276,7 @@ public: case KEY_BACKSPACE: if( sStr.getSize() > 0 ) - sStr.setSize( sStr.getSize()-1 ); + sStr.resize( sStr.getSize()-1 ); break; default: @@ -291,6 +294,8 @@ public: void findNext( const Bu::FString &sTerm ) { + RegEx re( sTerm ); + int y = sysCaret.iRow; if( y < 0 ) y = 0; @@ -300,7 +305,7 @@ public: StrArray &aRow = doc.sgData[y]; for( ; x < aRow.getSize(); x++ ) { - if( aRow[x].find( sTerm ) ) + if( re.execute( aRow[x] ) ) //aRow[x].find( sTerm ) ) { sysCaret.iRow = y; sysCaret.iCol = x; -- cgit v1.2.3