| Summary: | find and replaces do not work when block selection is on | ||
|---|---|---|---|
| Product: | [Applications] kate | Reporter: | Luca Sbordone <acarodp> |
| Component: | general | Assignee: | Christoph Cullmann <christoph> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | opensource |
| Priority: | NOR | ||
| Version First Reported In: | 2.3.2 | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Luca Sbordone
2005-01-16 14:11:45 UTC
Hi, this bug is still present in 3.4.0 beta2: Kate 2.4 (using KDE 3.3.92 (beta2)) hmm, in deed :/
could somebody tell me what this does in doSearch() ?
do {
if( regExp ) {
m_re = QRegExp( text, caseSensitive );
found = doc()->searchText( line, col, m_re,
&foundLine, &foundCol,
&matchLen, backward );
} else if ( wholeWords ) {
QRegExp re( "\\b" + text + "\\b", caseSensitive );
found = doc()->searchText( line, col, re,
&foundLine, &foundCol,
&matchLen, backward );
} else {
found = doc()->searchText( line, col, text,
&foundLine, &foundCol,
&matchLen, caseSensitive, backward );
}
if ( found && s.flags.selected )
{
if ( !s.flags.backward && KateTextCursor( foundLine, foundCol ) >= s.selEnd
|| s.flags.backward && KateTextCursor( foundLine, foundCol ) < s.selBegin )
found = false;
else if (m_view->blockSelectionMode())
{
if ((int)foundCol < s.selEnd.col() && (int)foundCol >= s.selBegin.col())
break;
}
}
line = foundLine;
col = foundCol+1;
}
while (m_view->blockSelectionMode() && found);
why the while (...blockSele...) stuff?
isn't this a duplicate of the already close bug #66022 ??? SVN commit 467563 by cullmann:
fix one block selection search bug ;)
BUG: 97140
M +3 -2 katesearch.cpp
--- branches/KDE/3.5/kdelibs/kate/part/katesearch.cpp #467562:467563
@@ -596,7 +596,7 @@
found = false;
else if (m_view->blockSelectionMode())
{
- if ((int)foundCol < s.selEnd.col() && (int)foundCol >= s.selBegin.col())
+ if ((int)foundCol < QMAX(s.selEnd.col(), s.selBegin.col()) && (int)foundCol >= QMIN(s.selEnd.col(), s.selBegin.col()))
break;
}
}
@@ -604,7 +604,8 @@
line = foundLine;
col = foundCol+1;
}
- while (m_view->blockSelectionMode() && found);
+ while (s.flags.selected && m_view->blockSelectionMode() && found);
+ // in the case we want to search in selection + blockselection we need to loop
if( !found ) return false;
|